TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. JRSF Home
    3. Topics
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 6
    • Best 0
    • Controversial 0
    • Groups 0

    Topics created by JRSF Home

    • JRSF HomeJ

      Opening in a particular Window size

      General Discussion
      • • • JRSF Home
      13
      0
      Votes
      13
      Posts
      468
      Views

      RussR

      @JRSF-Home, sorry, I forgot (again) that timeout command doesn't wait if the script is running in a context that doesn't have a console, like when the TRIGGERcmd agent runs it. It just moves on immediately.

      This chatgpt session explains it: https://chatgpt.com/share/691cf13c-2f64-8004-8b12-78dd516285a9

      You can see here that another user had the same problem.

      My suggestion is to use the ping command like this:

      ping 127.0.0.1 -n 3

      Adjust that 3 number depending on how long you want to wait.

      Here's my improved script that uses ping to wait, and it uses CTRL-SHIFT-J to go directly to the Console tab:

      "C:\Program Files\Google\Chrome\Application\chrome.exe" --new-window https://www.youtube.com/watch?v=1I9qC0Zo_PM ping 127.0.0.1 -n 5 REM x y width height nircmd win setsize stitle "Allow friends to control Spotify" 200 100 800 1000 nircmd win activate stitle "Allow friends to control Spotify" REM open dev tools to the Console tab nircmd sendkeypress ctrl+shift+j ping 127.0.0.1 -n 3 REM type document.querySelector('like-button-view-model button[aria-label*="like"]').click() nircmd sendkeypress d o c u m e n t 0xBE q u e r y Shift+s e l e c t o r Shift+0x39 0xDE l i k e 0xBD b u t t o n 0xBD v i e w 0xBD m o d e l spc b u t t o n 0xDB nircmd sendkeypress a r i a 0xBD l a b e l Shift+0x38 0xBB Shift+0xDE l i k e Shift+0xDE 0xDD 0xDE Shift+0x30 0xBE c l i c k Shift+0x39 Shift+0x30 REM press enter nircmd sendkeypress 0x0D ping 127.0.0.1 -n 2 REM close dev tools nircmd sendkeypress F12

      Here's a video of it working on my laptop: https://youtu.be/p-uJ8j1__zw

    • JRSF HomeJ

      Closing Apps created in Edge / Chrome Browsers

      General Discussion
      • • • JRSF Home
      4
      0
      Votes
      4
      Posts
      896
      Views

      JRSF HomeJ

      I've found out a bit more about why the taskkill command does not always work. If there is more than one instance of the browser open, only the one that Windows perceives to be active shows up in the task list. So if the browser App is minimised or you switch focus to another browser window, it 'dissappears' from the task list and the taskkill command fails.

      Unfortunately I haven't found a workaround yet!