Re: AppleScript and OSX
Re: AppleScript and OSX
- Subject: Re: AppleScript and OSX
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 16 May 2001 09:53:07 -0700
On 5/16/01 8:38 AM, "Simon Forster" <email@hidden> wrote:
>
Can anyone tell me why the simplest of snippets (given below) fails in OS X?
>
It seems to choke on "every item of".
>
>
tell application "Finder" to set my_contents to every item in folder
>
"London:Desktop Folder:Upload Folder"
Two different problems.
1) If you're using the 'full path' format then you need to use the
AppleScript keyword 'alias', not the Finder keyword 'folder' which wants
'folder "Upload Folder" of desktop '. If the Upload Folder is back on your
OS 9 desktop, and "London" is your OS 9.1 partition then this will work:
tell application "Finder" to set my_contents to every item in alias
"London:Desktop Folder:Upload Folder"
or:
tell application "Finder" to set my_contents to every item of folder
"Upload Folder" of folder "Desktop Folder" of disk "London"
2) If this Upload Folder is on your OS X desktop, then the problem is with
"Desktop Folder". OS X does not have a universal desktop. Each user (even if
only one) has his/her own desktop. If you investigate the Finder folders for
your OS X partition and file system, you'll see that the full path to your
desktop is rather different than in OS 8/9. In your own case, it's probably
something like:
"London:Users:forster:Desktop:"
So this would then work:
tell application "Finder" to set my_contents to every item in alias
"London:Users:forster:Desktop:Upload Folder"
If you have a separate OS X partition with a name other than "London", use
that instead.
>
>
Also, if I want an AppleScript to access a folder owned by another user, how
>
do I manage this? Can I give my script Super User privileges? If so, how.
I haven't looked into that yet, but all that is possible somehow.Someone
else will surely reply.
>
>
Finally, is OS X worth battling on with? It seems a half thought out, half
>
implemented joke at the moment - but then I'm probably just hacked off with
>
the whole thing today :-(
>
That's your choice. If you don't, you'll be left behind, of course.
--
Paul Berkowitz