Script to run on several computers without changing

Hi there,

I am trying to refine a script so it can run on several computers without changing. I know I can create a folder on the startup disk:
open folder “Photos” at startup disk
But is it possible to tell finder to open a specific folder on the current desktop without knowing the user name?
Something like: open folder “Photos” on current desktop of startup disk.

Is this possible?

Thank you very much for your help in advance.
Ken

I am a newby too…

But wouldn’t it be:


set myFilePath to ((path to home folder) & ":Desktop:myfile.txt")

???

The ‘path to’ command combined with ‘desktop’ will work on any Mac OSX computer and give the script the Finder reference to the current user’s desktop folder. Like so:

set pathToDesktop to path to desktop

– returns something like this: alias “SystemDisk:Users:username:Desktop”

Joseph,

Not to pick nits but a Finder reference would look something like this: folder “username” of folder “Users” of startup disk of application “Finder”

“path to desktop” returns an alias reference. :slight_smile:

– Rob

Yeah, I noticed that when I checked my code, but I figured mentioning that might confuse the issue. You missed a nit: I left out the last colon in my result note. :slight_smile: