Re: Making OS 9 scripts work in OS 10 - problems
Re: Making OS 9 scripts work in OS 10 - problems
- Subject: Re: Making OS 9 scripts work in OS 10 - problems
- From: Graff <email@hidden>
- Date: Sun, 28 Dec 2003 02:36:21 -0500
Give my examples a try. If they don't work then you most likely have
problems in your install of AppleScript.
On Dec 28, 2003, at 12:40 AM, Rob Stavis wrote:
We moved the photo-handling computer to an OS X box which allows us to
use
iPhoto -- a big plus-- so now I'm trying to makes these scripts run on
that
machine. The computer runs 10.2.6 with AS 1.9.1, and my test
environment is
10.3.1 with AS 10.9.2 -- I'm finding identical issues in both settings.
I spent a long time learning that to make a new folder, I had to make
new
+class cfol;. At least now I can make new folders.
Try this:
tell application "Finder"
make new folder at (path to desktop folder) with properties
{name:"New"}
end tell
Now, I'm hung up trying to deal with the disk "Macintosh HD". The
Finder
will no longer "select disk "Macintosh HD" but it can handle select
"Macintosh HD" (without the word "disk"). The Finder can't get the
properties of the disk and is unable to consider the disk "whose local
volume is false." System Events can get the properties of <<disk
"Macintosh
HD">>, but it doesn't know anything about "...whose local volume is
false."
This works fine on my machine, give it a try:
tell application "Finder"
select disk "Macintosh HD"
get properties of disk "Macintosh HD"
end tell
I need to mount a server disk "Macintosh HD" which is named the same
as the
local disk. I used to tell Finder:
Set remote_disk to disk "Macintosh HD" whose local volume is false as
alias
This should work:
tell application "Finder"
set theVolumes to every disk whose local volume is false
repeat with aDisk in theVolumes
if name of aDisk is "Macintosh HD" then
set remote_disk to aDisk
end if
end repeat
end tell
...but I'm now stuck on this. Also, I'm having trouble moving a folder
from
the local volume to the server. I can move the folder, but if it
exists,
there's an error message, and "replacing yes" which worked fine in the
OS 9
version won't compile.
This also works seems to work fine on my machine:
tell application "Finder"
move theFile to remote_disk replacing yes
end tell
I see in the dictionary that the sort command isn't now available, so
that
explains why that function isn't working, but the rest of the stuff
seems so
basic. I just spent $40 on Matt Neuburg's "Definitive Guide" hoping to
find
definitive guidance, but I'm still in the dark. I have the feeling
that a
file somewhere is missing, since AS seems to be only partly
functional. Can
someone shed some light on all this?
For a sort function you pretty much have to roll your own. There was
recently a big discussion of various sort routines that are easily
adaptable, search the archives for the discussion and you'll find a lot
of solutions.
If the examples that I gave you here are not working then something is
probably wrong with your install of AppleScript. I'm using the very
latest version of AppleScript available (1.9.3) but most of the
examples I gave here should work in earlier versions of AppleScript.
- Ken
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.