![]() ![]() When you compile the code, the comments are coloured grey and ignored when the script is run. These descriptions are known as ‘comments.’ To add a comment to an AppleScript, type two dashes then the text of your description, followed by another two dashes. Once you start writing scripts that contain more than a handful of lines, you’ll realise that hunting bugs and editing sections is much easier if you organise your code into sections with descriptions. Often the only way to find out if an app is recordable and what it allows you to record is to try it. ![]() Press the compile button (the one with a hammer icon on it) and save it.Įasy, huh? Sadly not all AppleScriptable applications support recording and those that don’t allow you to record every action. If it doesn’t compile successfully, AppleScript Editor will report an error and you’ll have to go back and check where you went wrong. When a script has compiled successfully, the text in it will be colour-coded to make it easier to read. Compiling an AppleScript checks the syntax and prepares the script for use. You just created your first AppleScript.īefore you can do anything with it, however, you need to compile it. You’ll see the scripting window populate with the script that describes the events you just recorded. Now, click on the Desktop, Press Cmd+Shift+N to create a new folder, and give it a name, say ‘My New Folder.’ Press stop to end the recording. ![]() To get an idea of how recording scripts works, launch Script Editor and select New Document. You can record actions you perform on your Mac, using AppleScript compatible apps, or you can write them from scratch. There are two ways you can create scripts in AppleScript Editor. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |