How to reference a file on users desktop with Applescript
I'm pretty new to Applescript and am trying to reference a file on the currently logged-on user's desktop, but I don't know how. In POSIX you开发者_开发百科'd use the tilde character to specify the user's home folder, but that doesn't seem to work in applescript. I've read other posts about how "desktop" is already defined as a keyword applescript understands, but I don't know how to specify a sub-folder of the pre-defined keyword (desktop/folder doesn't work).
Any help would be appreciated.
set theTargetFolder to ((path to Desktop Folder) & "name of target folder") as string
returns "Macintosh HD:Users:username:Desktop:name of target folder"
精彩评论