Mailing Lists: Apple Mailing Lists

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

Re: Popup Button Unique ID




On Jul 6, 2005, at 2:43 PM, Christopher Hickman wrote:

Hopefully someone will be able to tell us why that doesn't work, because the
code you listed should do it. What kind of variable is id_vendor now?


Christopher

Well I did make some headway. I still could not retrieve the tag value through a simple reference like...


set the_tag_value to tag of the_menu_item -- (Where the_menu_item is a reference to the menu item object)

What I did get tot work was to use the index of the menu item in the popup button but even then it is off by one diget - so it is saying it is for example at index 3 but that really refers to the item at index 2. So it appears that in the code below when I set "the_index" it is one integer less than when I retrieve the tag value using "the_index". Thus I had to add "1" to the index var to get it to matchup right. Here's the code.

set the_index to contents of popup button "the_vendors" of win_main
set the_index to the_index + 1
set the_id_vendor to tag of menu item the_index of menu of popup button "the_vendors" of win_main
display dialog the_id_vendor


How this can be I have no idea, I would love it if someone would tell me where my error is. Just to be clear, here is how I am setting the popup button menu items

-- An XMLRPC call is done just before this to set "the_data"

repeat with the_record in the_data
set the_vendor to the_vendor of the_record
set id_vendor to id_vendor of the_record
set the_menu_item to make new menu item at the end of menu items of menu of the_popup with properties {title:the_vendor, tag:id_vendor}
end repeat


If anyone has any help i would really appreciate it as this seems like a really sketchy way to do this

Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/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.