Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSScriptCommand with record parameter



I want to know which application is frontmost when I select a script in the script menu, so I put this into the sdef file of my application:

<command name="selected scriptmenu" code="TaCldosc" description="A Script menu item have been selected">
<cocoa class="SelectedScriptMenu"/>
<direct-parameter>
<type type="record" list="no"/>
</direct-parameter>
</command>

The script that I put in the script menu looks like this:

property frontmostApplication : "none"

tell application "System Events"
set frontmostApplication to item 1 of (get name of processes whose frontmost is true)
end tell

tell application "Tansa"
activate
selected scriptmenu {name:frontmostApplication, menu:5}
end tell

The result is printed out with a NSLog:

2007-11-23 07:33:32.822 Tansa[8848:10b] SelectedScriptMenu dict: {
    1886282093 = Mail;
    1668116085 = 5;
}

I thought the key should be the same as what I put in the script, "name" and "menu", but they came out as integers. Why?
How can I get the dict to be that?

Ivan
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-implementors/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.