At 10:33 -0700 23/10/07, Stockly, Ed wrote:
>I'm not sure why
>
>Path to "Desk" as unicode text
>
>works, but it seems to. I wouldn't recommend "path to" inside a Finder tell,
>especially when it's not needed.
>
try
tell app "Finder" to path to desktop as Unicode text
on error e
return e
end try
--=> "Finder got an error: Can't make desktop into type constant."
so...
tell app "Finder" to class of desktop folder
--=> constant
tell application "Finder" to class of desktop
--=> desktop-object ( when what is needed is a constant)
so give it an old-fashioned constant...
tell app "Finder" to path to «constant desk» as Unicode text -- ! 5 spaces!
--=> you get the path
But as this compiles to
tell application "Finder" to path to desktop as Unicode text
you can only run it once without an error. Ergo ...
run script "tell app \"Finder\" to path to «constant desk» as
Unicode text"
--=> "Mac Mini:Users:j:Desktop:"
and you've fooled 'em!
JD