• 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: Emmanuel LEVY <email@hidden>
  • Date: Sun, 01 Jul 2012 11:51:03 +0200

For the sake of understanding what's up let me throw a simple example, run these two blocks:

repeat with theItem in {1, 2, 3}
	if theItem is 3 then display dialog "3" -- never true
end repeat

repeat with theItem in {1, 2, 3}
	set theItem to contents of theItem
	if theItem is 3 then display dialog "3" -- works
end repeat

Best,
Emmanuel

On Jul 1, 2012, at 9:15 AM, Brian Christmas wrote:

>
> On 01/07/2012, at 3:14 PM, Ronald Hofmann wrote:
>
> 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
>
> # Now I have a repeat loop and I want to process all Items except the startup disk.
> # I´m doing this by creating a flag which checks if theItemDisk is not equal to my theStartupDisk
>
> repeat with theItemDisk in theListe
>
> 	set theFlag to (theItemDisk is not equal to theStartupDisk)
>
> 	if theFlag then
> 		log theItemDisk & ": " & theFlag
> 	end if
>
> end repeat
>
> G'day Ronald
>
> Try
>
> 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
>
> set thetest to {}
> repeat with theItemDisk in theListe
>
> 	set theFlag to (theItemDisk as text is not equal to theStartupDisk as text)
>
> 	if theFlag then
> 		set end of thetest to theItemDisk & ": " & theFlag
> 	end if
>
> end repeat
> thetest
>
>
> Regards
>
> Santa
>
> And what, you ask, was the beginning of it all?
> And it is this......
> Existence that multiplied itself
> For sheer delight of being
> And plunged with numberless trillions of forms
> So that it might
> find
> itself
> innumerably
>
> Sri Aurobindo
>
>
>
> _______________________________________________
> 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


 _______________________________________________
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>)
 >Re: True / False error on comparison (From: Brian Christmas <email@hidden>)

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