• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Extract keys, values from 'usrf' Record Type NSAppleEventDescriptor?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Extract keys, values from 'usrf' Record Type NSAppleEventDescriptor?
      • From: John Pannell <email@hidden>
  • Prev by Date: Re: Document not Saving Text View Attachment
  • Next by Date: lastKeyViewTraversingSubviewsBeginningWithView
  • Previous by thread: Re: Document not Saving Text View Attachment
  • Next by thread: Re: Extract keys, values from 'usrf' Record Type NSAppleEventDescriptor?
  • Index(es):
    • Date
    • Thread