MACSCRPT Archives

October 2007

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Proportional Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Mime-Version:
1.0
Content-Type:
text/plain; charset="windows-1252" ; format="flowed"
Date:
Wed, 24 Oct 2007 00:44:33 +0100
Reply-To:
Macintosh Scripting Systems <[log in to unmask]>
Subject:
From:
John Delacour <[log in to unmask]>
In-Reply-To:
Content-Transfer-Encoding:
8bit
Sender:
Macintosh Scripting Systems <[log in to unmask]>
Parts/Attachments:
text/plain (45 lines)
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

ATOM RSS1 RSS2