I am experimenting with automation of iPhoto (so as to be good in automation )
Can anyone please help me answer with following query?
I am thinking of using AppleScript, but I don’t know how will I compare a state with the previously saved state in AppleScript.
In technical terms I think it’s called CRC.
For instance, if I import some images in iPhoto (state 1), then delete those, and again import the same images (state 2), how can I check both states are same?
If you are comparing two image files, I don’t understand why you need to import them into iPhoto for comparison purposes. I’d probably consider the ‘diff’ command, possible wrapped in a do shell script command.
But I’ll assume you have important reasons for your workflow that I don’t understand. If you delete a photo in iPhoto, then click the trash icon in iPhoto, this snippet will return the path of the deleted image:
tell application "iPhoto"
activate
set thePhotos to get every photo in current album
repeat with thisPhoto in thePhotos
get image path of thisPhoto
end repeat
end tell
… which you could then compare to the file path of the newly imported image, and compare them without using iPhoto as an intermediary…
Thanks for your reply.
The scenario I posted was just one of many.
I want to automate iPhoto, so that a set of automated test cases, work on it regularly and compare the result with some standard value, and tell me if the test cases passed/failed.