Re: Trying to move away from Finder...


Michael Grant
 

Unless I'm missing the point here — entirely possible! — for whatever it's worth you actually don't need Finder *or* System Events for this particular task. The following does nicely, without any tell block:

set hfPath to POSIX path of (path to home folder)


(Not sure if this is built into the language itself or part of Standard Additions.)

Michael



On Wed, Nov 1, 2017 at 6:29 PM, Christopher Stone <listmeister@...> wrote:

And there are times when System Events will do things the Finder won't do:

------------------------------------------------------------------------------

set hfPath to path to home folder -- alias
tell application "System Events"
    set hfPath to POSIX path of hfPath -- POSIX Path
end tell

tell application "System Events"
    set hfPath to POSIX path of disk item "~/" -- POSIX Path
end tell

Join applescript@apple-dev.groups.io to automatically receive all group messages.