• 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: True / False error on comparison
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: True / False error on comparison


  • Subject: Re: True / False error on comparison
  • From: Luther Fuller <email@hidden>
  • Date: Sun, 01 Jul 2012 08:02:58 -0500

On Jul 1, 2012, at 12:14 AM, Ronald Hofmann wrote:

I have a list theListe with the Names of a disks whose size  > 0
And I have a variable theStartupDisk which contains the name of the startup disk.

tell application "Finder"
set theStartupDisk to name of startup disk --> "MacOSX"
set theListe to (name of disks whose size is greater than 0) as list  --> {"Backup1", "Graphics Tools", "MacOSX", "MacOSX2"}
end tell

You are inviting a problem by referring to disks by name. You can have two (or more) disks mounted which have the same name. This will confuse both you and AppleScript.

Do something like this ...

set theStartupDisk to path to startup disk -- an alias
tell application "Finder"
set theListe to (every disk whose size is greater than 0) as alias list
set startupID to id of theStartupDisk



repeat with aDisk in theListe -- for example
if id of aDisk = startupID then
display dialog "theStartupDisk = " & theStartupDisk as text
end if
end repeat
end tell


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >True / False error on comparison (From: Ronald Hofmann <email@hidden>)

  • Prev by Date: Re: True / False error on comparison
  • Next by Date: syntax error
  • Previous by thread: Re: True / False error on comparison
  • Next by thread: syntax error
  • Index(es):
    • Date
    • Thread