Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppleScript 🍏 #2

Open
3 tasks
BFGriffith opened this issue Feb 27, 2024 · 0 comments
Open
3 tasks

AppleScript 🍏 #2

BFGriffith opened this issue Feb 27, 2024 · 0 comments
Assignees
Labels
ἐπικός Multiple “user-story”/feature “issues” are like streams which combine to create an “EPIC” river…

Comments

@BFGriffith
Copy link
Owner

📜 AppleScript ideas&TASKS to AUTOMATE/interactively-PROGRAM for MacOS꞉

  • custom “Folder Actions”
  • Obsidian 🔮 interactions
  • Spotify interactions

AppleScript Language Guide ℹ

AppleScript is an official Apple scripting language that facilitates automated control over scriptable MacOS applications. First introduced in System 7, it is currently included in all versions of MacOS as part of a package of system automation tools. Moreover, the term “AppleScript” may refer to the language itself, to an individual .scpt scripts written in the language, or (informally) to the MacOS “Open Scripting Architecture” that underlies the language…

  • AppleScript is primarily a scripting language developed by Apple to do inter‑application communication (IAC) using Apple events, though AppleScript is related to but distinct from Apple events. Apple “events” are designed to exchange data between as well as control other applications in order to automate repetitive tasks…
  • AppleScript has some processing abilities of its own, in addition to sending&receiving Apple events to applications. AppleScript can do basic calculations+text‑processing, and is extensible꞉ allowing the use of scripting additions that add new functions to the language. Mainly, however, AppleScript relies on the functionality of applications and processes to handle complex tasks. As a structured command language, AppleScript can be compared to Unix shells, the Microsoft Windows Script Host, or IBM REXX, but it is distinct from all three… Essential to its functionality is the fact that Macintosh applications publish “dictionaries” of addressable objects&operations.
  • AppleScript has some elements of procedural‑programming, object‑oriented‑programming (particularly in the construction of script objects), and natural language programming tendencies in its syntax, but does not strictly conform to any of these programming paradigms…

AppleScript ⌘ₛ 🗂️

  • An application’s scriptable elements are visible in the application’s “Scripting Dictionary” (distributed as part of the application), which can be viewed in any script editor… Elements are generally grouped into suites, according to loose functional relationships between them. There are two basic kinds of elements present in any suite꞉ classes&commands.
    • Classes are scriptable objects꞉ for example, a text editing application will almost certainly have classes for windows, documents, and texts-and these classes will have properties that can be changed (window size, document background color, text font‑size, etc.), and may contain other classes (e.g. a window will contain one or more documents, a document will contain text, a text object will contain paragraphs and words&characters).
    • Commands, by contrast, are instructions that can be given to scriptable objects. The general format for a block of AppleScript is to tell a scriptable object to run a command.
      All scriptable applications share a few basic commands&objects (usually called the “Standard Suite”)꞉ such as commands to open, close, or save a file; to print something, to quit, or to set data to variables-as well as a basic application object that gives the scriptable properties of the application itself. However, many applications have numerous suites capable of performing any task the application itself can perform. In exceptional cases, applications may support plugins which include their own scripting dictionaries.
    • AppleScript was also designed with the ability to build scripts intuitively by recording user actions. Such AppleScript recordability has to be engineered into an app꞉ i.e. the app must actively support Apple events+AppleScript recording; thus, because Finder supports AppleScript recording, it can often be useful for developers as a reference. When AppleScript Editor (“Script Editor”) is open and the “Record” 🔴 button clicked, user actions for recordable apps are converted to their equivalent AppleScript commands and output into the Script Editor window… The resulting script can then be saved and re-run to duplicate the original actions, or modified to become more generally or contingently useful.

  • the AppleScript editor is typically located in /Applications/utilities
  • If you want an AppleScript script to show up in the “Folder Actions” Setup utility, place the .scpt file in the /Library/Scripts/Folder Action Scripts/ directory.
@BFGriffith BFGriffith added the ἐπικός Multiple “user-story”/feature “issues” are like streams which combine to create an “EPIC” river… label Feb 27, 2024
@BFGriffith BFGriffith self-assigned this Feb 27, 2024
@BFGriffith BFGriffith pinned this issue Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ἐπικός Multiple “user-story”/feature “issues” are like streams which combine to create an “EPIC” river…
Projects
None yet
Development

No branches or pull requests

1 participant