Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
AppleScript
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Resources== ==={{anchor|AppleScript Libraries}}AppleScript Libraries=== Re-usable AppleScript [[Library (software)|module]]s (available since [[OS X Mavericks]]), written in AppleScript or [[#AppleScriptObjC|AppleScriptObjC]] and saved as script files or bundles in certain locations,<ref>{{cite web |url=http://www.macosautomation.com/mavericks/libraries/ |title=AppleScript Libraries |website=macosautomation.com |access-date=May 8, 2017 |url-status=dead |archive-url=https://web.archive.org/web/20200726074006/http://www.macosautomation.com/mavericks/libraries/ |archive-date=2020-07-26}}</ref> that can be called from other scripts. When saved as a bundle, a library can include an AppleScript dictionary (sdef) file,<ref>{{cite web |url=http://asciiwwdc.com/2013/sessions/416 |title=WWDC 2013 Session 416: Introducing AppleScript Libraries |website=asciiwwdc.com |access-date=May 8, 2017}}</ref> thus functioning like a [[#Scripting Additions|scripting addition]] but written in AppleScript or AppleScriptObjC. ==={{anchor|AppleScript Studio}}AppleScript Studio=== A framework for attaching Cocoa interfaces to AppleScript applications, part of the Xcode package in Mac OS X 10.4 and 10.5, now deprecated in favor of AppleScriptObjC.<ref name="Neuburg">{{cite book |last=Neuburg |first=Matt |date=2006 |title=AppleScript: the definitive guide |edition=2nd |location=Beijing |publisher=[[O'Reilly Media]] |isbn=0596102119 |oclc=68694976}}</ref>{{rp|438}} ==={{anchor|AppleScriptObjC}}AppleScriptObjC=== A [[Cocoa (API)|Cocoa]] development [[software framework]], also called AppleScript/Objective-C or ASOC,<ref>{{cite web |last=Tsai |first=Michael |date=September 29, 2014 |title=AppleScript and Yosemite |url=https://mjtsai.com/blog/2014/10/29/applescript-and-yosemite/ |website=mjtsai.com |access-date=May 9, 2017}}</ref> part of the Xcode package since [[Mac OS X Snow Leopard]].<ref>{{cite web |url=https://developer.apple.com/library/content/releasenotes/ScriptingAutomation/RN-AppleScriptObjC/ |title=AppleScriptObjC Release Notes |website=developer.apple.com |access-date=May 8, 2017}}</ref> AppleScriptObjC allows AppleScripts to use Cocoa classes and methods directly.<ref>{{cite web |last=Waldie |first=Ben |date=September 6, 2012 |title=Building a basic AppleScriptObjC (Cocoa-AppleScript) application with Xcode |url=http://www.peachpit.com/articles/article.aspx?p=1942301 |website=peachpit.com |access-date=May 9, 2017}}</ref> The following table shows the availability of AppleScriptObjC in various versions of macOS:<ref>Table adapted from: {{cite web |last=Naganoya |first=Takaaki |title=ASObjCExtras Scripting Guide |url=http://www.piyocast.com/download_file/ASObjCExtras_scripting_guide.pdf |archive-url=https://ghostarchive.org/archive/20221009/http://www.piyocast.com/download_file/ASObjCExtras_scripting_guide.pdf |archive-date=2022-10-09 |url-status=live |website=piyocast.com |access-date=May 9, 2017}}</ref> {| class="wikitable" |+ Where AppleScriptObjC can be used in each macOS version |- ! scope=col | {{Screen reader-only|OS version}} !! scope=col | In [[Xcode]] !! scope=col | In applets !! scope=col | In [[#AppleScript Libraries|AppleScript<br/>Libraries]] !! scope=col | In [[AppleScript Editor|Script Editor]] |- | [[Mac OS X Snow Leopard|10.6]] || {{ya}} || || || |- | [[Mac OS X Lion|10.7]] || {{ya}} || {{ya}} || || |- | [[OS X Mountain Lion|10.8]] || {{ya}} || {{ya}} || || |- | [[OS X Mavericks|10.9]] || {{ya}} || {{ya}} || {{ya}} || |- | [[OS X Yosemite|10.10]] || {{ya}} || {{ya}} || {{ya}} || {{ya}} |- |} AppleScriptObjC can be used in all subsequent Mac OS X versions. ===Automator=== {{Main|Automator (software)}} A graphical, modular editing environment in which ''workflows'' are built up from ''actions''. It is intended to duplicate many of the functions of AppleScript without the necessity for programming knowledge. Automator has an action specifically designed to contain and run AppleScripts, for tasks that are too complex for Automator's simplified framework.<ref>{{cite web |url=https://developer.apple.com/library/content/documentation/AppleApplications/Conceptual/AutomatorTutorialAppleScript/Introduction/Introduction.html |title=Introduction to Automator AppleScript Actions Tutorial |website=developer.apple.com |access-date=May 8, 2017}}</ref> ===Scriptable core system applications=== These background-only applications, packaged with macOS, are used to allow AppleScript to access features that would not normally be scriptable. As of Mac OS X 10.6.3 they include the scriptable applications for: :* [[VoiceOver]] (scriptable auditory and braille screen reader package) :* System Events (control of non-scriptable applications and access to certain system functions and basic file operations) :* Printer Setup Utility (scriptable utility for handling print jobs) :* Image Events (core image manipulation) :* HelpViewer (scriptable utility for showing help displays) :* Database Events (minimal SQLite3 database interface) :* AppleScript Utility (for scripting a few AppleScript related preferences) ==={{anchor|Scripting Additions}}Scripting Additions (OSAX)=== Plug-ins for AppleScript developed by Apple or third parties.<ref name="OSAX">{{cite web |url=https://developer.apple.com/library/content/technotes/tn1164/_index.html |title=Technical Note TN1164: Scripting Additions for Mac OS X |website=developer.apple.com |access-date=May 8, 2017}}</ref> They are designed to extend the built-in command set, expanding AppleScript's features and making it somewhat less dependent on functionality provided by applications. macOS includes a collection of scripting additions referred to as Standard Additions (''StandardAdditions.osax'') that adds a set of commands and classes that are not part of AppleScript's core features, including user interaction dialogs, reading and writing files, file system commands, date functions, and text and mathematical operations; without this OSAX, AppleScript would have no capacity to perform many basic actions not directly provided by an application.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)