Chip, Thanks for your perspective on this. It sounds logical, but I don't think it fits my situation. The 2 apps I had the conflict with were my Capbeeper app and a new app I am creating called Version Check. Capbeeper had a test property of Capbeeper and an ID property of cbMenu. Version Check had the standard WEScript Framework properties with a text property of Version Check and an ID of my_script_menu. So it seems they should have functioned independently. I will do some more testing tomorrow and report back.
One other thing I don't understand is that the WEScript Framework always creates the same name for the menu of my_script_menu and the same MenuItem ID with menu_help. Yet, this always worked correctly in my apps. It did not fire twice like the E-mail menu item. I also had identical menu_hkm menu items and they fired correctly for the correct app. It seems to be a problem only with the one option. This doesn't make any sense to me. Vic -----Original Message----- From: Chip Orange [mailto:[email protected]] Sent: Wednesday, June 22, 2011 9:46 PM To: [email protected] Subject: RE: Problem creating an E-mail message through a menu Hi Vic, Sorry, but I don't agree with Bruce's suggestion. each app has it's own environment, which includes it's own variables, open objects, and monitored events. they don't get intermixed. However, having said that, the apps menu is the one place where apps do share something: this common menu structure, where they each can place a menu. I think your primary menu id needs to be different for each app, and that will solve this (I think you've tripped over a WE bug actually). I think once you make each menu have a unique name, you can have menu items with the same name in both. If you decide to test out this theory, please let us know if it solves your issue. thanks. Chip -----Original Message----- From: BT [mailto:[email protected]] Sent: Wednesday, June 22, 2011 8:56 PM To: [email protected] Subject: Re: Problem creating an E-mail message through a menu Hi Vic, I was noticing that as well. Now, if you had a flag that got set the first time you sent the email inside the event, it probably would go away also once you check for the flag being set. the problem with events, is they get called when monitoring the vent. since you have both monitoring the event then both will trigger it. Like all apps, you must narrow down the scope and either change ID's or place a flag there... Bruce Sent: Wednesday, June 22, 2011 8:49 PM Subject: RE: Problem creating an E-mail message through a menu As a second addendum, I now changed my MenuItem ID to be different in 1 of the conflicting apps and the problem went away. It appears to only affect global apps because I have a program-specific app with the same E-mail Me option and when I had it running along with the 2 global apps I only got 2 messages, not 3. Is this to be expected or is this a bug? -----Original Message----- From: Vic Beckley [mailto:[email protected]] Sent: Wednesday, June 22, 2011 8:35 PM To: GW Scripting List Subject: Problem creating an E-mail message through a menu As an addendum to this message, I disabled 1 of my global apps with this menu choice and only got 1 new message. Why would this be happening? Shouldn't WE only execute the code for the app who owns the menu choice that was selected? Is there any way to work around this? If menu items that are the same are executed even though they are for different apps, this could get very messy if 2 app authors accidentally came up with the same menu items. -----Original Message----- From: Vic Beckley [mailto:[email protected]] Sent: Wednesday, June 22, 2011 8:02 PM To: GW Scripting List ([email protected]) Subject: Problem creating an E-mail message through a menu Hi all, I need some help with a problem. I am adding a menu choice to my app's menus to send me an E-mail. I now have 2 global apps with the identical menu code and vbs code to accomplish this. When I choose the E-mail Me option on the app's menu, I get 2 E-mail messages coming up addressed to me, instead of just 1 as I would expect. Here is the code I am using. XML file: <menu id="my_script_menu">Version Check <menuitem id="menu_hkm" enabled="yes" shortcut="k"><![CDATA[Change Hot Key]]></menuitem><menuitem id="menu_update" shortcut="u"><![CDATA[Check for Update]]></menuitem><menuitem id="menu_email" shortcut="e"><![CDATA[E-mail Me]]></menuitem><menuitem id="menu_help" shortcut="h"><![CDATA[Help]]></menuitem></menu> VBS file: Dim myMenu : Set myMenu = Menu(myXMLFile, "my_script_menu", "MenuProc") Function MenuProc(menuObj, id) MenuProc = False Select Case id Case "menu_help" If Not SO_StandardHelpDialog Is Nothing Then Queue "ScriptHelp" End If MenuProc = True Exit Function Case "menu_hkm" Queue "RunHotkeyManager" MenuProc = True Exit Function Case "menu_update" Queue "ManualCheckForUpdates" MyMenuProc = True Exit Function Case "menu_email" SharedObjects("com.GWMicro.GWToolkit.LaunchUrl")("MailTo://" & myStrings("EmailAddress")) MenuProc = True Exit Function End Select End Function Any idea why I would get 2 messages? I have 2 global apps using the exact same XML and VBS structure. Could WE be running the code twice because of that? Also, does anyone know of a way that I can fill in the Subject field of the new message along with the To field? Vic
