Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Using scripts with different versions of AppleScript

Hi,

I have a script that works perfectly in my Apple Script Editor v2.4.3 and Language AppleScript 2.2.1 I've given that script to a friend of mine with AppleScript Editor 2.7 and Apple Script Language 2.4


The script does not work properly in their AppleScript Editor, does anyone know why this might be and/or how to remedy it? Is there a way for them to download Language 2.2.1 to use or is there a way to figure out how I need to update my code to work for the 2.4 language.


Thanks

MacBook Pro, Mac OS X (10.7.5)

Posted on Apr 28, 2015 1:34 PM

Reply
Question marked as Best reply

Posted on Apr 28, 2015 1:52 PM

There are no assurances that Apple will not introduce new AppleScript features that change how older scripts behave, or that Application scripting dictionaries won't (they do) change between operating system releases. If you use GUI scripting, you are almost certainly going to get burned by UI changes.


As far as I know, you are stuck with the AppleScript Editor and AppleScript version on their original OS X release. You will need bootable versions of each OS X release that you plan to distribute your AppleScript solutions too, and test your applications on each one.


I have been developing AppleScript applications (including those with other scripting languages embedded) on Mavericks, and then retesting them on Yosemite. Now, I develop on Yosemite, because the Scripting Editor is superior to its predecessor on Mavericks or earlier. I then test these scripts back on Mavericks.

2 replies
Question marked as Best reply

Apr 28, 2015 1:52 PM in response to thundercleese8

There are no assurances that Apple will not introduce new AppleScript features that change how older scripts behave, or that Application scripting dictionaries won't (they do) change between operating system releases. If you use GUI scripting, you are almost certainly going to get burned by UI changes.


As far as I know, you are stuck with the AppleScript Editor and AppleScript version on their original OS X release. You will need bootable versions of each OS X release that you plan to distribute your AppleScript solutions too, and test your applications on each one.


I have been developing AppleScript applications (including those with other scripting languages embedded) on Mavericks, and then retesting them on Yosemite. Now, I develop on Yosemite, because the Scripting Editor is superior to its predecessor on Mavericks or earlier. I then test these scripts back on Mavericks.

Apr 28, 2015 2:12 PM in response to thundercleese8

Hello


Whilst scripts using certain features of the latest version of AppleScript language won't even complile on previous versions, scripts written for previous versions should usually work in later versions with some exceptions.


cf.

https://developer.apple.com/library/mac/releasenotes/AppleScript/RN-AppleScript/

https://developer.apple.com/library/mac/releasenotes/AppleScript/RN-AppleScript/ RN-AppleScript.pdf



- Notable change introduced in 10.8 is new requirement on referencing file system object.


E.g.,


open "/path/to/file"



may work under 10.7 but not under 10.8 or later. Instead you need to use:


open "/path/to/file" as POSIX file



etc.



- Notable change introduced in 10.9 is new requirement on using Accessibility and GUI scripting.


cf.

OS X: Using AppleScript with Accessibility and Security features in Mavericks

http://support.apple.com/kb/HT5914



Good luck,

H

Using scripts with different versions of AppleScript

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