Scripting Filepaths
Scripting Filepaths
- Subject: Scripting Filepaths
- From: Jon Rosen <email@hidden>
- Date: Wed, 29 Jul 2009 20:21:41 -0400
These may be basic questions, but I would appreciate your assistance.
First, is there a shortcut for referring to a file in a user
directory? I can use path to desktop or /Desktop for the Mac's
desktop. But, how can I refer to the current user's desktop without
using their name? For example:
This works fine: open POSIX file "/Users/admin/Desktop/Sheaffer
Flattop.png"
This does not: open POSIX file "~/Desktop/Sheaffer Flattop.png"
I don't understand why "~" doesn't work with AppleScript filepaths.
The next question is how to refer to the enclosing folder of a file?
That syntax doesn't seem to work anymore. For example, if I choose a
file with a Choose File command, how can I simply get the folder that
contains that file? Do I have to break down the filepath and figure it
out for myself or is there a simpler way to do this?
Thanks,
Jon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden