PDA

View Full Version : macros execute twice



ldave
October 29th, 2009, 03:30 PM
Hello all

I'm running G5 under WinXP Pro. I'm a complete newb at G5, no Lua (yet), but lots of VB. So treat me like an idiot with a really steep learning curve. First project: operate software via Snapstream Firefly RF remote thru G5. Attached is gml file I'm working up. So far so good for one day. But I've run into a snag I can't seem to lick: macros are executing twice. Verified in the Logger. There are two FILE EXECUTEs triggered by remote keypresses that each open an app. Each macro is hooked into a file open and executes some setups on each app after opening and a WAIT (or two). But the macros execute twice. Logger verifies order of events:

FILE EXECUTE
TaskCreate file[Create]
macro executes
TaskSwitch file <<<< is this the probem?
TaskCreate file[Create] shows up again
macro executes
macro exits

I've parsed and parsed and I just don't see it. What's the goofy?

Thanks
Dave

Rob H
October 30th, 2009, 03:48 AM
That's a bit puzzling - my first thought was that you were executing the file execute action twice, but that doesn't seem to be the case. It does rather look as though you're getting the task create event twice for some strange reason.

Does the same problem occur if you run the file execute action from Girder using the Test button or F5?

And how about if you run notepad.exe instead of e.g. nRoute.exe?

Ron
October 30th, 2009, 06:54 AM
Maybe use an anti-repeat to suppress the second start?

ldave
October 30th, 2009, 11:54 AM
I'll have time later to take a look at inplementing you guys' suggestions for fixes. Just can't right now. Will post back with results, especially solution. Been dealing with Garmin lately, and fast, knowledgeable support responses, while easy to take for granted, are definitely appreciated by me. Thanks 3 big.

Dave

ldave
October 30th, 2009, 07:12 PM
OK, so...Creating a 1000 ms anti-repeat for each of the FileOpen hooks for the macros solves the issue. I didn't try it with Notepad: it's doing it for both nRoute and Mapsource here in the same gml. I tried activating and deactivating various controls for the hooks, but the anti-repeat was only one with success. It'll be tricky to trouble-shoot because all keypresses are really two key 'strokes' anyway, right? down and then the up back to start position. Any keypress on my remote registers two 'little green button' flashes on the bottomleft of G5. And these can be handled separately by G5, I'm assuming. At first blush, I'd wonder if somehow these things are firing on both the down and up. The 'up' box isn't ticked for any of my stuff. Unless I'm completely whacked, of course. Ya know I'm not reading the directions for every little thing here. I'm a bit feeling around bumping into things. Thanks much for the pointer(s). I'l check back in in a while when I can recite the serial number to this remote in my sleep.

Dave