Sebastian42 Posted August 20, 2021 Report Share Posted August 20, 2021 Acantor - my apologies for the mistakes in my previous thread; there was worse which I have not reported upon. The success I reported was an illusion. So I want to start from scratch with a new title. When I run a shortcut called SendLeap, it opens a Chrome window. Manually, I can then TAB four times, then press ENTER and the SendLeap App opens in Chrome. I want a macro to do that for me, then I will get a batch file to call that macro and automate the launching of SendLeap at Windows StartUp. When I 'open file location' for the shortcut, I get "C:\Program Files\Google\Chrome\Application\chrome_proxy.exe"; When I enter that path in the Program tab of 'Launch program and Activate Window' and save the macro and run it, nothing happens. How can I fix this first step ? Quote Link to comment Share on other sites More sharing options...
acantor Posted August 20, 2021 Report Share Posted August 20, 2021 Try this path to chrome.exe instead of the path you're using to Chrome_proxy.exe: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe Quote Link to comment Share on other sites More sharing options...
Sebastian42 Posted August 20, 2021 Author Report Share Posted August 20, 2021 That (without the 'x86', since mine is a 32bits system), gave me the illusion of success before. As expected, that merely opened Chrome - NOT the App. Experimenting I'm willing to do, but somehow I feel the existing shortcut to the app HAS TO BE part of the path. Quote Link to comment Share on other sites More sharing options...
Sebastian42 Posted August 20, 2021 Author Report Share Posted August 20, 2021 I reverted to your original suggestion of using SendLeap.lnk - that launched the required Chrome window. It so turns out that it is a matter of having sufficient delay between the following steps to achieve success. I am now in the process of reducing delays to make it less unwieldy - but the end result I have already achieved. Thank you. Quote Link to comment Share on other sites More sharing options...
Sebastian42 Posted August 21, 2021 Author Report Share Posted August 21, 2021 Sad to say - rarely it works, more often it does not. The macro by itself seemed faultless, but when called by a batchfile at Windows StartUp, it became quite unreliable. Quote Link to comment Share on other sites More sharing options...
acantor Posted August 22, 2021 Report Share Posted August 22, 2021 It looks like your script is using a "Text Type" instruction as a comment. If you are, then your script may be sending keystrokes that might gum up the works. In Macro Express, you can sprinkle a script with comments, you can include comments for individual instructions, or you can do both. If you include a comment with an instruction, make sure the instruction is doing what you want it to do. // This is a comment Text Type (Simulate Keystrokes): Hello // This is a comment for a "Text Type" instruction Mouse Move: 5, 5 Relative to Last Position // This is a comment for a "Mouse Move" instruction Delay: 100 milliseconds // This is a comment for a "Delay" instruction // This is another comment Quote Link to comment Share on other sites More sharing options...
Sebastian42 Posted August 22, 2021 Author Report Share Posted August 22, 2021 Previously I had been able to find a 'comment command', but since that has eluded me now, I did second best by entering comments as a 'text command' but without actual text. I can try without any comments, and presumably if/when you reply, you'll tell me where to find the 'comments command' again. Quote Link to comment Share on other sites More sharing options...
Sebastian42 Posted August 22, 2021 Author Report Share Posted August 22, 2021 Removing the comments did nothing to improve the reliability Quote Link to comment Share on other sites More sharing options...
acantor Posted August 22, 2021 Report Share Posted August 22, 2021 10 hours ago, Sebastian42 said: if/when you reply, you'll tell me where to find the 'comments command' again. "Script" tab "Macro Control" "Comment" It would be helpful to see your entire script. Instead of a screen shot of the Script Editor, select the code in the Script Editor, copy it, and paste it into the forum. Quote Link to comment Share on other sites More sharing options...
Sebastian42 Posted August 22, 2021 Author Report Share Posted August 22, 2021 Thank you for that instruction - so easy - explains why I found it originally, but it's a mystery why it evaded me now. Code : <COMMENT Value="Launches first preliminary window of SendLeap as a Chrome App"/> <PROGRAM LAUNCH Path="C:\\sendleap.lnk" Mode="\x00" Default_Path="TRUE" Wait="1" Get_Console="FALSE"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="That got 'Learn more' selected"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="That got 'Turn on enhanced protection' selected "/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="That got 'Back to Safety' selected"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="That got 'Advanced' selected"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <COMMENT Value="That got 'Hide Advanced' displayed"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="<TAB>"/> <COMMENT Value="That got 'Proceed to SendLeap' selected"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <COMMENT Value="That achieved the opening of SendLeap app"/> Quote Link to comment Share on other sites More sharing options...
acantor Posted August 22, 2021 Report Share Posted August 22, 2021 The code looks fine. Your comments are clear. The only change I would suggest is increase the delay on Line 3 to four or five seconds. Some applications need a lot more than a second to fully load. You may need a longer delay on Line 18, as well. Once you find the delay that reliably opens the window, you may be able to shorten other delays. Typically I don't add delays when tabbing around. Quote Link to comment Share on other sites More sharing options...
Sebastian42 Posted August 23, 2021 Author Report Share Posted August 23, 2021 The first response to increased delay is good - SendLeap launched as wanted. Let's see if it persists. Quote Link to comment Share on other sites More sharing options...
acantor Posted August 23, 2021 Report Share Posted August 23, 2021 A macro that interacts with an application's user interface cannot be 100% reliable. There are endless ways things can go wrong: a program might fail to launch, a screen might not appear in time, another application might steal focus, and so on. So if your macro ALMOST always works, consider it a success! Quote Link to comment Share on other sites More sharing options...
Sebastian42 Posted August 24, 2021 Author Report Share Posted August 24, 2021 I can only confirm that yet again, the batch file did NOT deliver. I will take your advice and settle for less than 100% reliability [or go back to doing manually]. Thank you for your patience. Quote Link to comment Share on other sites More sharing options...
acantor Posted August 25, 2021 Report Share Posted August 25, 2021 On 8/21/2021 at 6:57 PM, Sebastian42 said: The macro by itself seemed faultless, but when called by a batchfile at Windows StartUp, it became quite unreliable. This might be an important clue. Please describe how you call the macro from a batch file. Is the only time you need to run this macro when you start your computer? Quote Link to comment Share on other sites More sharing options...
Sebastian42 Posted August 26, 2021 Author Report Share Posted August 26, 2021 Yes, the only time I need to run this macro when I start my computer. Sometimes (NOT usually), the whole process completes successfully from the batch file. @echo off timeout 20 Start "" "C:\Program Files\Macro Express Pro\MacExp.exe" /ASendleap Cls Exit Quote Link to comment Share on other sites More sharing options...
acantor Posted August 26, 2021 Report Share Posted August 26, 2021 It's been a very long time since I last wrote or used a batch file! Is it possible that the failure is due to the batch file running before Macro Express is ready? To troubleshoot, temporarily remove the batch file from the start up group. Manually run the batch file AFTER you are certain Macro Express is loaded. Ensure Macro Express in the startup group. When Macro Express is fully loaded, its icon will be in the System Tray. Also, assuming your macro is hotkey activated, check whether it runs reliably and consistently when you press the hotkey. Quote Link to comment Share on other sites More sharing options...
Sebastian42 Posted August 26, 2021 Author Report Share Posted August 26, 2021 I ran the macro from a hotkey successfully twice, the third time another Chrome window (with advertisements) also opened, and the macro steps were NOT visible in the 'first' window. 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.