• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Newbie wants to move drive icons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie wants to move drive icons


  • Subject: Re: Newbie wants to move drive icons
  • From: What does not kill you only makes you stronger <email@hidden>
  • Date: Tue, 23 Jan 2001 22:17:05 -0600

on 01/23/01 7:43 PM, email@hidden wrote:

> 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?

Here are a few different ways:

tell application "Finder"
activate
try
set kDisk to disk "Audio CD 1"
set position of kDisk to {80, 711}
on error errmssg
activate
display dialog errmssg
end try
end tell

tell application "Finder"
activate
if (list disks) contains "Audio CD 1" then
set kDisk to disk "Audio CD 1"
set position of kDisk to {80, 711}
end if
end tell

tell application "Finder"
activate
try
set kDisk to disk "Audio CD 1"
set position of kDisk to {80, 711}
end try
end tell

tell application "Finder"
set allEjectableDisks to every disk whose ejectable = true
repeat with anEjectableDisk in allEjectableDisks
put away anEjectableDisk--do something with the disk
end repeat
end tell

tell application "Finder"
activate
set kSomeDisks to every disk whose name starts with "M"
--> {disk "Mac OS X", startup disk}
end tell



Play around, I am sure you will find some interesting creative solutions to
accomplish your goals.

Nate


References: 
 >Newbie wants to move drive icons (From: Dale Saukerson <email@hidden>)

  • Prev by Date: Re: Count of Tab characters
  • Next by Date: Re: whose name contains space
  • Previous by thread: Newbie wants to move drive icons
  • Next by thread: Re: Newbie wants to move drive icons
  • Index(es):
    • Date
    • Thread