开发者

How to reference a file on users desktop with Applescript

开发者 https://www.devze.com 2023-01-11 01:54 出处:网络
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 th

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"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号