• 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
Keyword selection in iPhoto generates incorrect list.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Keyword selection in iPhoto generates incorrect list.


  • Subject: Keyword selection in iPhoto generates incorrect list.
  • From: Chris Glowacki <email@hidden>
  • Date: Wed, 27 Feb 2008 10:05:44 -0800

All,

 this script (intended to export to a user-chosen folder all  'keyed' photos  into subfolders named by keyword)

tell application "iPhoto"
activate
set key_list to every keyword whose name does not start with "_"
set new_folder to (choose folder) as alias
repeat with this_key in key_list
set plist to (every photo whose keywords contains this_key)
set photocount to count of plist
if photocount is not 0 then
set new_name to name of this_key
tell application "Finder"
try
set this_folder to make new folder at new_folder with properties {name:new_name}
display dialog "wait"
end try
end tell
set move_list to {}
repeat with this_photo in plist
set cpath to image path of this_photo as POSIX file as alias
if move_list does not contain cpath then
set end of move_list to cpath
end if
end repeat
tell application "Finder"
duplicate move_list to folder new_name of folder new_folder
end tell
end if
end repeat
end tell

seems to generate an odd list (here called 'plist')
The result of set plist to (every photo whose keywords contains this_key) is a list with the first photo missing, and the 2nd photo entered twice - is this a bug? is photo 1 being over-written? is my syntax incorrect?  Does anyone have any bright ideas?

Here is what it generates (partial event log dump)
tell application "iPhoto"
activate
get every keyword whose name does not start with "_"
{keyword "Key_1", keyword "Key_2", keyword "Key_3", keyword "Key_4", keyword "Key_5"}
choose folder
alias "Main:Users:chrisg:Desktop:ExportHere:"
get every photo whose every keyword contains keyword "Key_1"
{photo id 4.294967425E+9, photo id 4.294967425E+9, photo id 4.294967426E+9, photo id 4.294967427E+9, photo id 4.294967428E+9, photo id 4.294967429E+9, photo id 4.29496743E+9, photo id 4.294967431E+9, photo id 4.294967432E+9, photo id 4.294967433E+9, photo id 4.294967434E+9, photo id 4.294967435E+9, photo id 4.294967436E+9, photo id 4.294967437E+9, photo id 4.294967438E+9, photo id 4.294967439E+9, photo id 4.29496744E+9, photo id 4.294967441E+9, photo id 4.294967442E+9, photo id 4.294967443E+9, photo id 4.294967444E+9, photo id 4.294967445E+9, photo id 4.294967446E+9, photo id 4.294967447E+9, photo id 4.294967448E+9}
get name of keyword "Key_1"
"Key_1"


thanks

chris

 _______________________________________________
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

  • Prev by Date: osascript: application isn't running. huh?
  • Next by Date: Re: applescript & installer behavior
  • Previous by thread: Re: osascript: application isn't running. huh?
  • Next by thread: More iPhoto Scripting Oddness
  • Index(es):
    • Date
    • Thread