MACSCRPT Archives

October 2007

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
Levon Spradlin <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 24 Oct 2007 09:17:23 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (73 lines)
Thanks everyone for helping me understand this situation in more detail. Its
nice to know there can be multiple ways to attack a task sometimes. If Quark
were this easy to learn, my job would be much easier!

Levon Spradlin
Technology Manager, Desktop Publishing Support Services
Pearson | Assessment & Information
512-989-5300 x 3989
[log in to unmask]

•







From: John Baltutis <[log in to unmask]>
Reply-To: Macintosh Scripting Systems <[log in to unmask]>
Date: Tue, 23 Oct 2007 19:32:14 -0700
To: <[log in to unmask]>
Subject: Re: Simple Finder script erroring out getting path to desktop

On 10/24/07, Richard Morton <[log in to unmask]> wrote:
> On 24/10/2007, at 9:21 AM, John Baltutis wrote:
>
>> On 10/22/07,  Levon Spradlin <[log in to unmask]> wrote:
>>> I get an AppleScript Runtime Error when trying this simple code. I am
>>> copying it from known working tutorial scripts, thinking that my
>>> syntax was off in my project. It makes my head hurt when simple does not
>>> work. AmI doing something wrong?
>>>
>>> tell application "Finder"
>>> set theDesktop to path to desktop as Unicode text
>>> end tell
>>>
>>> Finder got an error: Can't make desktop into type constant.
>>
>> Wrong app. Try:
>>
>> tell application "System Events"
>>  set x to path to desktop as Unicode text
>> end tell
>
> Actually, it works fine to tell Finder as long as the correct syntax
> is used:

Thanks for clarifying, as did the others who responded. I only ran it with
System Events, didn't get any errors, and posted my findings. Nice to know
there are alternatives.

> tell application "Finder"
>  set theDesktop to the desktop as Unicode text
> end tell
>
> The problem is that "path to" is a Standard Additions command and the
> term "desktop" is defined by both Finder and the OSAX.  In a "System
> Events" tell there is no conflict.
>
> This also works without any app tell:
>
> path to desktop as Unicode text



**************************************************************************** 
This email may contain material confidential to
Pearson.  If you were not an intended recipient, 
please notify the sender and delete all copies. 
We may monitor email to and from our network. 
****************************************************************************

ATOM RSS1 RSS2