Re: Photo ID from iPhoto Import?
Re: Photo ID from iPhoto Import?
- Subject: Re: Photo ID from iPhoto Import?
- From: kai <email@hidden>
- Date: Sat, 19 Feb 2005 17:22:50 +0000
On Saturday, February 19, 2005, at 05:32 am, I wrote:
Of course, for a batch routine, the script I suggested could be easily
adapted:
[snip]
Just a couple of additional thoughts on this, August...
Firstly, you expressed some concern about Irwin's suggestion to use
'photos of last import album' - on the basis that another photo,
imported at the same time, could be referred to in error. It may
therefore reassure you to know that I tried to do just that - and found
that iPhoto sensibly locked me out until the current import was
completed.
However, to use this method successfully, it's necessary to ensure that
the "iPhoto/Preferences.../Show last [N] roll(s) album" option is
checked - and that its value [N] is set to 1. In addition, to avoid the
risk of an empty list being returned by an "id of photos of last import
album" statement, the last import album must evidently be selected
first - something like this:
-------------------------
tell application "iPhoto"
import from choose folder
tell last import album
select
set idList to id of photos
end tell
end tell
repeat with n from 1 to count idList
set idList's item n to (idList's item n) mod 16777216
end repeat
idList
-------------------------
The second point is this. On Saturday, February 19, 2005, at 04:32 am,
I wrote:
It doesn't seem currently possible to get a list satisfying a
condition (i.e. a 'whose' filter), so I guess you'll have to loop
through the latest list.
However, to be fair, I was probably pushing it a bit by telling iPhoto
to "set idList to id of photos whose id is not in prevList". Presenting
just a single condition to satisfy was rather more successful. To do
this, I filtered the post-import IDs using the highest value extracted
from the pre-import list:
-------------------------
tell application "iPhoto"
repeat with n from (count photos) to 1 by -1
set maxID to photo n's id
if (count (photos whose id > maxID)) is 0 then exit repeat
end repeat
import from choose folder
set idList to id of photos whose id > maxID
repeat with n from 1 to count idList
set idList's item n to (idList's item n) mod 16777216
end repeat
end tell
idList
-------------------------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden