Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 776
EightQuarterBit Avatar asked Aug 12 '10 14:08

EightQuarterBit


1 Answers

set theTargetFolder to ((path to Desktop Folder) & "name of target folder") as string

returns "Macintosh HD:Users:username:Desktop:name of target folder"

like image 98
Philip Regan Avatar answered Sep 30 '22 14:09

Philip Regan