I’m working on converting an OS9 script to OSX. The script refers to a folder on the users’ desktop, whose path is obviously different for each OS (the folder is called “Coding Logs”). The script needs to work on different Macs for different people, so I can’t specify the Mac or User name. I have two problems:
In OSX, how can I refer to a folder on the User’s desktop, without specifying the User or Mac name? In OS9 it’s easy, because there’re no users, so I can just do this:
set codingLogFolder to alias ((name of startup disk) & ":Desktop Folder:Coding Logs:")
The only code I know that works in OSX is this, but it specifies the user (in this case, “guest”):
set codingLogFolder to alias "Work:Users:guest:Desktop:Coding Logs:"
(Note, that “Work” is the name of the partition where the User directories reside. It is the same setup for each Mac that this script will run on.)
Ideally, the script heeds to temporarily run on both OS’s. Since the syntax for specifying the folder location is different, is this possible? Can I get the script to check which OS it’s on first?
Everything else about the script works the same in both environments, so this is this only thing I’m stuck on.
One caveat to this is that if the call to the “path to” command is inside a Finder tell block, you need to change it from “path to desktop” to “path to desktop folder”:
Jon
[This script was automatically tagged for color coded syntax by Script to Markup Code]