"path to apps" not behaving as expected

I’m trying to write a script that needs to be able to run on multiple versions of OS X. Unfortunately, under 10.2.8 “path to apps” doesn’t seem to be behaving the same way as it does under 10.3.x and 10.4.x. When I use “path to apps” under 10.3.x or 10.4.x, I get xxx:Applications where xxx is the disk name. On 10.2.8, the same thing points to the Applications folder underneath the home directory of the user running it, for example: xxx:/Users/admin/Applications. Can somebody explain to me why this works differently on 10.2.8, and what command I can use to give me the path to the applications folder that will work on any OS X version. Writing portable code using Applescript has turned out to be a nightmare. I can write a shell script that will work on just about any vendor’s Unix, but writing Applescript that works on any version of OS X seems to be a skill that is eluding me… :frowning:

Shawn Asmussen

The first line (following) gets the Applications folder in the User folder. The second line gets the Applications folder for the local domain, or as you expect as noted in your comment.

path to applications folder from user domain
path to applications folder from local domain

Cool. Thanks for the info. So, did the default change from 10.2 to 10.3, and that’s why I get different results on the different versions when I don’t specify the domain?

Shawn Asmussen

I don’t know. I thought the ‘from x domain’ has been a part of ‘path to’ since the beginnings of OS X. I’ve been specifying domains since it was available, whenever it was, so I’ve never known of the problem.