Getting iPhoto album ID with AppleScript
Getting iPhoto album ID with AppleScript
- Subject: Getting iPhoto album ID with AppleScript
- From: Nikita Zhuk <email@hidden>
- Date: Sat, 13 Oct 2007 14:19:34 +0300
Hi,
I'm developing an application which communicates with iPhoto via
AppleScript. My application tracks some iPhoto albums by using their
numeric album IDs, which are read from the AlbumData.xml file
generated by iPhoto. A requirement of my application is to be able to
change names of iPhoto albums by using their numeric album IDs. Since
I don't see any way to say this directly in AppleScript (i.e. "set
name of album with id 123 to 'TheNewName"), I use a loop where I loop
through all iPhoto albums, check whether album's ID is the same
integer as my id and set name of the found album.
However, I get some unexpected album IDs with iPhoto version 7.1 (347)
on Mac OS X 10.4.10. If I try to fetch the id of the 7th album, I get
the following results:
1.
tell application "iPhoto"
id of album 7
end tell
Result: 4.294967297E+9
2.
tell application "iPhoto"
id of album 7 as integer
end tell
Result: -2.147483648E+9
3.
tell application "iPhoto"
id of album 7 as unsigned integer
end tell
Result: 1
The 7th album has album id of 1, according to AlbumData.xml. Could
someone explain why I get values seen in first two cases (0x100000001
and 0x80000000)? In some other test cases (which I cannot reproduce
with my current iPhoto library) I've got the same result as in the
first case also in the third case, where I cast the return value to
unsigned integer.
Best regards,
Nikita Zhuk
_______________________________________________
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