Newbie wants to move drive icons
Newbie wants to move drive icons
- Subject: Newbie wants to move drive icons
- From: Dale Saukerson <email@hidden>
- Date: Tue, 23 Jan 2001 19:43:47 -0600
I'm new to this list and still at the Kindergarten level of
AppleScript scripting knowledge.....I'm comfortable with FileMaker
and QuicKeys scripting.
I'm writing a script to do some desktop volume icon positioning at
startup--I can move fixed volume icons just fine, but I run in to
trouble trying to move removable drive icons like an Audio CD mounted
via the built in DVD player.
My trouble is I don't have a reliable way to first test to see if an
Audio CD icon is available before commanding it to move.
Another weakness of my script is I that depend upon a fixed name
(Audio CD 1). This works fine at startup when any mounted CD is named
Audio CD 1 but not later on after I've popped a few CDs in and out
and the get their consecutive numbering (Audio CD 1, Audio CD 2, etc).
I've used the AudioCDgh addition for a few years now, but it
apparently is not entirely compatible with a DVD drive. If the drive
is empty (regardless if a disc was ejected or never inserted) the
drive is reported as stopped rather then offline. So I can not use it
to properly test to see if the drive is empty.
I've been to MacScripter.net, but I haven't found any additions to
help me determine simply if the drive is empty or full.
I have the book "The Tao of AppleScript".
Here is my elementary script
tell application "Finder"
activate
select disk "Audio CD 1"
set position of selection to {80, 711}
end tell
This script of course fails if the drive is empty or the mounted
volume name does not match.
Questions:
1-Is there a way to halt a script if *any* error occurs rather than
trapping for specific errors?
This would be quickest for me but not conducive to learning
more fundamental concepts.
2-How can I determine if the DVD drive is empty or full?
3-How can I look for a variable CD name as opposed to a known fixed name?
4-Can I use a wildcard for the last character when referring to a volume name?
5-Could you make this work for *any* disc mounted in the drive (like
a DVD or Photo disc rather that an Audio CD?
Please help educate me! My forehead has been banging on the keyboard
a lot lately....The only book I own is the Tao of AppleScript.
Dale Saukerson
email@hidden
G4/400 Yikes PCI running OS 9.1 with 256 megs.