Mime-Version: |
1.0 (Apple Message framework v752.2) |
Content-Type: |
text/plain; charset=US-ASCII; delsp=yes; format=flowed |
Date: |
Wed, 24 Oct 2007 09:44:20 +1000 |
Reply-To: |
|
Subject: |
|
From: |
|
In-Reply-To: |
<f05210607c344322bb6b1@[192.168.1.100]> |
Content-Transfer-Encoding: |
7bit |
Sender: |
|
Parts/Attachments: |
|
|
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:
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
|
|
|