Group Details Private

administrators

Member List
  • RE: How do I Cancel My Subscription

    @jett, you'll need to cancel your subscription from your Paypal account.

    posted in General Discussion
  • RE: Short Bookmark says device is offline but shows online in main PC list,

    @Smart-Communities, why not click that Configure button for your short bookmark, and re-select the computer/command combo?

    posted in General Discussion
  • RE: Short Bookmark says device is offline but shows online in main PC list,

    @Smart-Communities, I think you need to edit your short bookmark and re-select your reboot command.

    I suspect maybe you renamed your computer?

    I just did that - I added a space between New and Laptop. It made my short bookmark red because it no longer matched the computer name:
    fa911404-13be-4763-99d2-901b0e7f6e07-image.png

    Then I fixed it by editing my short bookmark and re-selecting my reboot command:
    e0fcb2ed-9847-4dfa-b148-03071cb30308-image.png

    About your idea to have the ability to view all standard and short bookmarks - it's not possible to show the standard bookmarks because they're not stored in the database. The standard bookmarks use a JWT, which is what makes them so long.

    posted in General Discussion
  • RE: Short Bookmark says device is offline but shows online in main PC list,

    @Smart-Communities the red on the Short Bookmarks page is not showing the online/offline status of the computer. It's telling you that the command/computer combo no longer exists.

    For example, I have a command on my DS computer that no longer exists. I probably renamed it.
    857324b0-d705-4d65-9521-d931e4d447c9-image.png

    If you click Configure, it will show you a blank Select Trigger field with a pulldown to re-select something for that short bookmark URL.
    fc8a3105-5b74-48bf-a2c4-f1c94d4e85cb-image.png

    About your other questions:

    Q: Possible to display short bookmarks on the main " View Triggers" screen?
    A: It's currently not possible. How about I move the "Create Short Bookmark" button to the top of the Bookmark page?

    Q: Create shorter bookmarks by default?
    A: I think there's a legit use case for the original bookmarks. They're meant to be ephemeral - they can expire after a set number of hours. They're also invalidated if the command is deleted or renamed. Short bookmarks are valid as long as the computer name and command name they refer to exist.

    Q: If I delete offline devices will they come back if eventually online again?
    A: No, so if you delete a computer, you'll need to re-input a token when the agent runs on it again, and it will create a new computer record for it at that point.

    posted in General Discussion
  • RE: Opening in a particular Window size

    @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

    posted in General Discussion
  • RE: Operation on VMware virtual PCs

    @hondaru2004, here's a powershell script that will create a new computer in your TRIGGERcmd account. It assumes you installed the agent on the master PC you cloned because it uses the token.tkn file from that install for authentication. It writes the computer ID and computer name to the config files in the user's home directory. I hope this helps.

    # === Configuration ===
    $urlprefix = "https://triggercmd.com"
    $computername = $env:COMPUTERNAME
    
    # Read token from TRIGGERcmd token file
    $tokenPath = Join-Path $env:USERPROFILE ".TRIGGERcmdData\token.tkn"
    
    if (Test-Path $tokenPath) {
        $token = Get-Content $tokenPath -Raw | ForEach-Object { $_.Trim() }
        Write-Host "Token loaded from: $tokenPath" -ForegroundColor Green
    } else {
        Write-Host "Error: Token file not found at $tokenPath" -ForegroundColor Red
        Read-Host "Press Enter to exit"
        exit 1
    }
    
    # === Perform the POST request ===
    Write-Host "Making API request..." -ForegroundColor Green
    
    $headers = @{
        "Authorization" = "Bearer $token"
        "Content-Type" = "application/x-www-form-urlencoded"
    }
    
    $body = "name=$computername"
    
    try {
        $response = Invoke-RestMethod -Uri "$urlprefix/api/computer/save" -Method POST -Headers $headers -Body $body
        
        # === Display the full response ===
        Write-Host "`nAPI Response:" -ForegroundColor Yellow
        $response | ConvertTo-Json -Depth 10 | Write-Host
        
        # === Extract and save the ID ===
        $computerId = $response.data.id
        
        if ($computerId) {
            # Save ID to TRIGGERcmd config file
            $computerIdPath = Join-Path $env:USERPROFILE ".TRIGGERcmdData\computerid.cfg"
            $computerNamePath = Join-Path $env:USERPROFILE ".TRIGGERcmdData\computername.cfg"
            
            # Ensure the directory exists
            $triggerCmdDir = Split-Path $computerIdPath -Parent
            if (!(Test-Path $triggerCmdDir)) {
                New-Item -ItemType Directory -Path $triggerCmdDir -Force | Out-Null
            }
            
            # Save ID to file
            $computerId | Out-File -FilePath $computerIdPath -Encoding ASCII -NoNewline
    
            # Save computer name to file
            $computername | Out-File -FilePath $computerNamePath -Encoding ASCII -NoNewline
            
            Write-Host "`nExtracted ID: $computerId" -ForegroundColor Cyan
            Write-Host "ID saved to: $computerIdPath" -ForegroundColor Green
            Write-Host "Computer name saved to: $computerNamePath" -ForegroundColor Green
        } else {
            Write-Host "`nError: Could not find ID in response" -ForegroundColor Red
        }
        
    } catch {
        Write-Host "`nError making API request:" -ForegroundColor Red
        Write-Host $_.Exception.Message -ForegroundColor Red
    }
    
    Write-Host "`nRequest completed." -ForegroundColor Green
    

    Run the script with a command like this:
    powershell -ExecutionPolicy Bypass -File .\change_tcmd_id.ps1

    Or, you could just delete the computerid.cfg file and it will prompt you for the token like when you first install the agent.

    posted in General Discussion
  • RE: Opening in a particular Window size

    @JRSF-Home

    Think script worked pretty well for me. It does something similar to your use-case. It opens a Youtube video in a new Chrome window in a specific location on the screen, with specific dimensions, and presses the Like button.

    It uses a Chrome dev tools console command to find the like button and click it.

    "C:\Program Files\Google\Chrome\Application\chrome.exe" --new-window https://www.youtube.com/watch?v=1I9qC0Zo_PM
    timeout 4
    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
    nircmd sendkeypress F12
    timeout 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
    timeout 1
    
    REM close dev tools
    nircmd sendkeypress F12
    

    It's a little low-tech because it simulates a lot of key presses. There's probably a better way using puppeteer or selenium but this works if you don't care.

    posted in General Discussion
  • RE: Opening in a particular Window size

    @JRSF-Home, I see what you're trying to do and why.

    Here's a long command line that uses && to combine multiple commands into one:

    "C:\Program Files\Google\Chrome\Application\chrome.exe" --new-window https://triggercmd.com && timeout 5 && nircmd win activate stitle "TRIGGERcmd: Remotely run" && nircmd win setsize stitle "TRIGGERcmd: Remotely run" 800 100 500 500
    

    It opens triggercmd.com in a new Chrome window, waits 5 seconds, then resizes and positions the window.

    Personally, instead of that super long command line I would create a .bat file like this and have TRIGGERcmd run the .bat file.

    "C:\Program Files\Google\Chrome\Application\chrome.exe" --new-window https://triggercmd.com
    timeout 5
    nircmd win activate stitle "TRIGGERcmd: Remotely run"
    nircmd win setsize stitle "TRIGGERcmd: Remotely run" 800 100 500 500
    

    The nircmd win command parameters aren't super intuitive, but you can see how I had it find the Chrome window by the "TRIGGERcmd: Remotely run" text that the Chrome window's title starts with.
    https://nircmd.nirsoft.net/win.html

    I know you also want to click a button on the page. I'm looking into how to run a command like this in the Chrome console using the keyboard so you could have nircmd do that part too:

    document.querySelector('#yourButtonId').click();
    

    Please try the script or command though. It worked for me.

    This shows how I simulated clicking the Sign In button on the triggercmd.com login page using this method. Now I just need to figure out the series of keystrokes to automate it with nircmd.

    37c540f7-2496-4c5e-bb47-93830d5d8db6-image.png

    posted in General Discussion
  • RE: Opening in a particular Window size

    @Xander, got it. Sorry I thought you were suggesting he use Chrome to launch a shortcut. I get your original meaning now.

    Just so it's clear to OP, he could put start c:\path\to\shortcut.lnk in the Command field or include it in his script that TRIGGERcmd could run for him. Example:

    start C:\Users\russe\Desktop\Claude.lnk
    

    Then if he pre-configured the Run field of that .lnk shortcut, he could make it open Maximized.

    870d6398-667f-48d1-a855-aebe81f945c5-image.png

    As for OP's 3rd request - to click a button within that window, I'd ask ChatGPT. Just asked it "how to click a button on a web page with a script." here:
    https://chatgpt.com/share/68fe7888-36f8-8004-9c72-e7c6385f927b

    posted in General Discussion
  • RE: MacOS - A JavaScript error occurred in the main process

    @Simon thanks again for reporting the error. I'll see if I can reproduce it. It looks like it's in the Home Assistant integration. Sorry about the trouble.

    EDIT: I see from your screenshot that this.computer_name was null for some reason, so I added code to prevent a crash when that happens. I'll produce a new version soon.
    https://github.com/rvmey/TRIGGERcmd-Agent/commit/b54e988e7d251105bc6faa8c3fa6a5240644cbef

    EDIT2: Done - please upgrade to the current version (v1.0.52) to avoid that error in the future.

    posted in General Discussion