terrypin Posted February 15, 2012 Report Share Posted February 15, 2012 Is it possible to scope a macro when the target is 'running under javascript'? As an example, when I'm using Street View in Google Maps with Firefox and I switch to full screen mode, the only way I've found to activate a macro is to keep it global. I think the reason is that javascript has taken over at this point. If so, I wonder if maybe an AutoIt script could get around this? -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
paul Posted February 15, 2012 Report Share Posted February 15, 2012 It's not clear to me how you want to activate your macro. Quote Link to comment Share on other sites More sharing options...
terrypin Posted February 15, 2012 Author Report Share Posted February 15, 2012 It's not clear to me how you want to activate your macro. Ideally I'd like to be able to activate it (with the hotkey Win+Ctrl+s) only when Firefox is displaying a Google Maps window. -- Terry, UK Quote Link to comment Share on other sites More sharing options...
Samrae Posted February 16, 2012 Report Share Posted February 16, 2012 This worked for me: Launched Firefox and brought up Google Maps. Created new macro Gave it HotKey activation of Win+Ctrl+s Clicked Scope tab Chose "Window/Program Specific" Clicked Add Window Chose "Google Maps - Firefox" from the list displayed Changed to "Google Maps -" Entered the following macro: If Not Window "Google Maps -" is focused Macro Stop End If Text Box Display: Google Maps is running Quote Link to comment Share on other sites More sharing options...
paul Posted February 16, 2012 Report Share Posted February 16, 2012 I was going to recommend an approach similar to Samrae's excellent text, but he beat me to it! Quote Link to comment Share on other sites More sharing options...
terrypin Posted February 16, 2012 Author Report Share Posted February 16, 2012 Thanks Samrae, but that simple approach doesn't work for me. Did you test the key requirement described in my original post, namely that it should be activated when GM is in Street View and Full Screen? Perhaps I should have repeated that in my follow-up to Paul... -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
Samrae Posted February 17, 2012 Report Share Posted February 17, 2012 Then something like this might work: Variable Set Integer %ScnWidth%: Set to the Screen Width Variable Set Integer %ScnHeight%: Set to the Screen Height Variable Set Integer %CurWinWidth%: Set to the Current Window's Width Variable Set Integer %CurWinHeight%: Set to the Current Window's Height // See if the app is maximized If Variable %CurWinWidth% Does not Equal "%ScnWidth%" And If Variable %CurWinHeight% Does not Equal "%ScnHeight%" Text Type (Simulate Keystrokes): <WIND><CTRLD>s<CTRLU><WINU> // Send Win+Ctrl+s in case another application needs it Wait for Text Playback Macro Stop End If If Not Window "Google Maps -" is focused Macro Stop End If Text Box Display: Google Maps is running I did not test this. You may have to adjust the comparisons between %ScnWidth% with %CurWinWidth% and %ScnHeight% with %CurWinHeight% to account for borders. Quote Link to comment Share on other sites More sharing options...
terrypin Posted February 17, 2012 Author Report Share Posted February 17, 2012 Thanks Samrae, appreciate your efforts. I've worked around the issue in a rather simpler way. Some brief background: the ultimate objective was to capture and save screenshots of a certain size and aspect ratio from either Google Earth (GE) or Google Maps (GM). In both cases these apps were in their Street View mode and Full Screen. I found that GM cannot be activated by any ME Pro macro while it is in that mode, unless the macro's scope is set to global. So, with hundreds of hotkey-activated macros, that reduced my flexibility. My approach is to use this macro Screenshot GE/GM (16:9) Variable Set String WindowTitle to topmost window title If Variable %WindowTitle% Equals "Google Earth" Macro Run: Screenshot GE - fixed size Else // If title is NOT Google Earth, assume it is GM in full screen Street View. Macro Run: Screenshot GM from full screen End If It's activated by Win+Ctrl+s. Screenshot GE - fixed size is scoped to GE. Screenshot GM from full screen is globally scoped. I have no other macros activated by Win+Ctrl+s. Note: When any macro operates on GM in that mode, it has the immediate result of switching it out of full screen mode (but staying in SV). -------------------- BTW, am I right that to preview a post it's now necessary to go through an extra stage to bring up the Preview button? If so, seems a backward step IMO! -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.