Is there a comprehensive AppleScript learning resource beyond outdated books?

I feel like I'm barely scratching the surface of what AppleScript can do, but any documentation online usually just ends up in a command reference and trial / error.


I'm hesitant to pursue much further trying when it doesn't look like there's much in the way of education past books published in the 2000's.


Is there anything besides Introduction to AppleScript Language Guide that can take someone from creating basic actions to more complex interactions between apps and OS?


I'd ideally like to create a Workflow/Scripting combo that can take a spreadsheet file I've received, dropped in a folder, open it, parse out rows of information, append them to the end of specific Numbers sheet, highlight a column and set the cell format to "Pop Up Menu", then copy the last cell in the column with data and paste with style to another sheet (for a drop down).


I also have Alfred if that is better.


This code below is my first script that copies several pieces of info to use for various pasting to 3rd party apps. You can see how much I don't know with this. :-)


I need a reference to help do what I want, and how to tighten up my code.


tell application "Numbers"
activate
set selection range of table 3 of sheet 1 of document 1 to cell 1 of row 2 of table 3 of sheet 1 of document 1
end tell

tell application "System Events"
keystroke "c" using command down
end tell

delay 1

tell application "Numbers"
set selection range of table 4 of sheet 1 of document 1 to range "A2:A5" of table 4 of sheet 1 of document 1
end tell

tell application "System Events"
keystroke "c" using command down
end tell

delay 1

tell application "Numbers"
set selection range of table 1 of sheet 1 of document 1 to cell 1 of row 1 of table 1 of sheet 1 of document 1
end tell

tell application "System Events"
keystroke "c" using command down
end tell

delay 1

tell application "Numbers"
activate
set selection range of table 1 of sheet 1 of document 1 to cell 1 of row 6 of table 1 of sheet 1 of document 1
end tell

tell application "System Events"
keystroke "c" using command down
end tell

delay 1

tell application "Numbers"
activate
do shell script "screencapture -cPR1810,530,720,720 $HOME/Pictures/PatchImage2.png"
end tell


[Re-Titled by Moderator]

iMac 27″, macOS 15.3

Posted on Apr 8, 2025 1:37 PM

Reply
5 replies

Apr 9, 2025 8:17 AM in response to Scroat

Although there is the AppleScript Language Guide online, you should use its information in conjunction with the specific application's scripting dictionary support if that exists.


When you launch the Script Editor, it presents you with a File chooser and a New Document button. Click that button to put a new blank document on your Desktop. Then, you can select File menu > Open Dictionary… to see the list of applications that have AppleScript dictionary support. Look at Apple's Numbers as an example. That is the keyword glue that gives you access to table data, but no examples to further help you understand how these keywords are used to achieve your goal.


Goal definition is important as one has to turn to the Internet and a search engine to ask how to use AppleScript with Numbers to achieve that coding goal to see examples of actual code that accesses Numbers. Then, you have to understand the date of the example post as if it is accessing Numbers '09 its scripting dictionary is a superset of what is provided with Numbers v3 and later. The MacScripter site is a good source of AppleScript examples. You will likely need to take the description of what you want to do in Numbers and break it into individual searches to arrive at the contributory examples that help you arrive at the full-coded solution.




Apr 8, 2025 3:20 PM in response to Scroat

Here is the Apple (archived) documentation: Mac Automation Scripting Guide: About Mac Scripting


I’d look at learning zsh, bash, or Swift, any of which are seeing more activity than AppleScript. (For learning Swift, the (free) Swift Playgrounds app can be a useful start. And Swift can run interactively, or can be built as an app.)


Why? AppleScript hasn’t seen a whole lot of focus at Apple, nor much new work since JavaScript was added in OS X 10.10; a decade ago. And there are gaps in that JavaScript for Automation (JXA) work. New automation work from Apple has gone into the Shortcuts app.


Yes, AppleScript is good at scripting GUI apps, but it’s not so good at other tasks, and AppleScript apps tend to be somewhat fragile.


Shells including zsh, and bash can use osascript commands to perform GUI operations where needed, while Swift has other access.


This approach can mean your app designs will follow different directions, such as using a database and not scripting a spreadsheet via the Numbers app, or exporting from Numbers into CSV or another format, and then processing that.


As a local alternative, NocoDB (docs). There are others. And the SQLite database is build in.


(I miss Bento. Its replacement Filemaker Pro is yet more capable, but is also much more expensive.)


Apr 9, 2025 8:38 AM in response to Scroat

AppleScript has been Apple's primary user-centric scripting technology since before Mac OS X. It first appeared over 30 years ago. It's one of the last remnants of the old "classic" MacOS operating system.


Going forward, I strongly recommend you consider Shortcuts instead. That is Apple's new scripting technology for iOS. The idea is that it will eventually replace AppleScript on macOS once the remaining AppleScript users die off (literally).

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Is there a comprehensive AppleScript learning resource beyond outdated books?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.