• 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: More questions about scripting iPhoto
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More questions about scripting iPhoto


  • Subject: Re: More questions about scripting iPhoto
  • From: "Mark J. Reed" <email@hidden>
  • Date: Mon, 25 Feb 2008 23:19:57 -0500

Minor tweaks to exit the keyword loop when a match is found (shouldn't
matter much); turned  the "found none"  into a "found this many" and
moved it, since you could have a keyword with no photos.

set desiredTagName to "chase" -- change as desired
tell application "iPhoto"
	set desiredTag to false
	repeat with tag in keywords
		if tag's name is desiredTagName then
			set desiredTag to tag
			exit repeat
		end if
	end repeat
	if desiredTag is false then
		set taggedPhotos to {}
	else
		set taggedPhotos to every photo whose keywords contains desiredTag
	end if
	display dialog ("Found " & (count taggedPhotos) as string) & " photos
with keyword '" & desiredTagName & "'"
	taggedPhotos
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: 
 >More questions about scripting iPhoto (From: Chris Glowacki <email@hidden>)
 >Re: More questions about scripting iPhoto (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Smart Folder Scripting
  • Next by Date: Re: Smart Folder Scripting
  • Previous by thread: Re: More questions about scripting iPhoto
  • Next by thread: Re: More questions about scripting iPhoto
  • Index(es):
    • Date
    • Thread