Re: Itunes - persistent ids not unique (or, managing double integers)
Re: Itunes - persistent ids not unique (or, managing double integers)
- Subject: Re: Itunes - persistent ids not unique (or, managing double integers)
- From: Matt Deatherage <email@hidden>
- Date: Sat, 11 Mar 2006 04:06:08 -0600
On 3/11/06 at 2:20 AM, Andrew Bush <email@hidden> wrote:
> turns out that the persistent ids stored in the xml file are
> alphanumeric and once passed in to an applescript are not accepted by
> the applescript as being double integers anyway...presumably itunes
> alters their format within the xml file for storage purposes.
Nah, you're leaping to conclusions. It looks like this in the XML
file:
> <key>Persistent ID</key><string>564921533442263F</string>
..and that's just hexadecimal. Double integers (long ints) are 64
bits wide, and so is that value - you can tell because it's 16
hexadecimal digits. I'm sure there are a wide variety of hexadecimal
conversion options for AppleScript, but it doesn't matter, since
*AppleScript* converts every double integer to real when it receives
it, as noted previously.
Not "the AppleScript," but AppleScript itself - the code that Chris now
writes. :-) You can't do anything in your script about this; it's in
the AppleScript OSA language component itself. If you have Script
Debugger, you might try JavaScript OSA and see if it handles double
integers.
(And, of course, if you were creating and receiving Apple events
directly in C or another high-level language, you wouldn't have to
convert 64-bit integers to floating point numbers if you didn't want
to. AppleScript does right now, though. Maybe in Leopard it won't.)
--Matt
--
Matt Deatherage <email@hidden>
GCSF, Incorporated <http://www.macjournals.com>
"Unix geeks are the Amish of the computer world." -- Jens Alfke
_______________________________________________
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