Extract keys, values from 'usrf' Record Type NSAppleEventDescriptor?
Extract keys, values from 'usrf' Record Type NSAppleEventDescriptor?
- Subject: Extract keys, values from 'usrf' Record Type NSAppleEventDescriptor?
- From: Jerry Krinock <email@hidden>
- Date: Sat, 20 Feb 2010 21:15:17 -0800
I create an NSAppleScript to read the current window name and URL from Safari and return it as a record [1]. When I execute it, I get a nice-looking NSAppleEventDescriptor with the following -description (line breaks added for readability):
<NSAppleEventDescriptor: {
'usrf':
[
'utxt'("aNam"),
'utxt'("Apple"),
'utxt'("aUrl"),
'utxt'("http://www.apple.com")
] }>
As you can see, the desired keys and values are all in there. How can I get them out? (Spent an hour reading documentation to no avail.)
Thanks,
Jerry Krinock
[1]
tell application "Safari"
set aName to name of front document
set aUrl to URL of front document
end tell
set aRecord to {aNam:aName, aUrl:aUrl}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden