TRIGGERcmd
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Example Commands
    3. Mac
    Log in to post
    • Newest to Oldest
    • Oldest to Newest
    • Most Posts
    • Most Votes
    • Most Views
    • Russ

      Close an app on a Mac
      • Russ

      1
      0
      Votes
      1
      Posts
      2052
      Views

      No one has replied

    • H

      Wake up lan on mac
      • holmstockd

      2
      0
      Votes
      2
      Posts
      1197
      Views

      Russ

      @holmstockd, I haven't done it, but I see that it's possible. http://osxdaily.com/2013/12/14/wake-on-lan-mac-iphone/

    • Matt Packwood

      Run a shell script on a Mac
      • Matt Packwood

      3
      0
      Votes
      3
      Posts
      693
      Views

      Russ

      @CheddarLifeForm and @Matt-Packwood,

      You don't need to escape forward slashes yourself if you use the GUI editor. Just enter the paths like this: ~/script.sh (to refer to a script in your home directory). You only need to worry about escaping backslashes if you're editing your commands.json file directly.

      Here are some tips:
      Make your script executable with a command like this:
      chmod +x script.sh

      The ~ charactor refers to your home folder, so you can put scripts in folders in your home folder, and refer to them in the GUI editor like this: ~/scripts/myscript.sh

      Test your script from the bash prompt before testing in the GUI editor, and test using the green Play button in the GUI editor before testing using the Trigger button on the website, and test using that Trigger button before using something like Alexa.

      If you want to see the output from your commands, write it to a log file with >> like this:
      echo Hi >> ~/log.txt

    • Russ

      Mac's open command - too powerful
      • Russ

      3
      0
      Votes
      3
      Posts
      1850
      Views

      Russ

      @Felipe-Martins, log into your Slack workspace in a browser, then in the same browser, go here to add the TRIGGERcmd Slack app to your workspace:

      https://www.triggercmd.com/user/auth/slack

      If that doesn't answer your question, let me know and I'll elaborate, and add more details here.

    • M

      How to Unlock your screen Mac
      • marciomayer

      6
      0
      Votes
      6
      Posts
      529
      Views

      Russ

      @marciomayer, for security, Mac OS won't allow programs to interact with the password prompt.

    • Vanessa Soares

      Sleep on Mac
      • Vanessa Soares

      1
      2
      Votes
      1
      Posts
      1563
      Views

      No one has replied

    • Vanessa Soares

      How to turn on Macbook?
      • Vanessa Soares

      2
      0
      Votes
      2
      Posts
      594
      Views

      Russ

      @Vanessa-Soares, this shows how you can enable wake-on-lan, but do you have another computer that could send the "magic packet" to the macbook?

      https://www.microcenter.com/tech_center/article/7596/how-to-enable-or-disable-wake-on-lan-in-mac-os-x

    • Ivan Freitas

      Shutting down the macbook command
      • Ivan Freitas

      7
      0
      Votes
      7
      Posts
      4477
      Views

      D

      Hi guys, here's a script I set up to simulate the standard Mac shutdown. I hope you like it!

      osascript -e 'tell application "System Events" to click menu item "Shutdown…" of menu 1 of menu bar item "Apple" of menu bar 1 of process "Finder"'

    • Russ

      Say Alexa/Hey Google, turn off/on display
      • Russ

      1
      0
      Votes
      1
      Posts
      353
      Views

      No one has replied

    • Russ

      Play/Pause etc with osascript
      • Russ

      6
      0
      Votes
      6
      Posts
      1495
      Views

      Russ

      I found a simple one-line command for pressing space, which is useful for play/pause.

      echo "tell application "System Events" to keystroke " "" | osascript

    • Russ

      Mute/Unmute/Volume
      • Russ

      2
      0
      Votes
      2
      Posts
      1821
      Views

      Waldex Santos

      How to do next track and previous track?

    • Waldex Santos

      next track and previous track
      • Waldex Santos

      7
      0
      Votes
      7
      Posts
      1757
      Views

      Russ

      @Waldex-Santos, this will play 80's love songs:

      osascript -e 'tell application "Spotify" to play track "spotify:playlist:37i9dQZF1DXc3KygMa1OE7" '

      You can get the "track" info from Share -> Copy Spotify URI

      According to this file, there's also a playpause option but no way to set the volume in Spotify. You can set the Mac's general volume though of course.

      /Applications/Spotify.app/Contents/Resources/Spotify.sdef
    • Robertofilho

      How to connect the PC after sleep mode
      • Robertofilho

      4
      0
      Votes
      4
      Posts
      648
      Views

      Russ

      @Rafael-Sathler, I just realized these are Mac commands and the topic was in the Windows section, so I moved this over to the Mac section.

      I wonder if that's where the confusion came from.

    • George Contento

      how to make a batch file for X10 control on mac
      • George Contento

      2
      0
      Votes
      2
      Posts
      146
      Views

      Russ

      @George-Contento, I found that this seems to be the only remaining Mac software that's still supported:
      http://www.indigodomo.com/downloads.html

      I also found you can still download the Thinking Home software here, but it's not supported anymore.

      I haven't tried either one myself yet.

      Terminology-wise, a "batch file" is a .bat file and only works on Windows. For Mac and Linux you'd want to make a bash script (usually with a .sh extension) like this:

      #!/bin/bash if [ "$1" == "off" ] then echo turn light $1 >> /tmp/on_off.log # Put your command to turn the light **off** here. else echo turn light $1 >> /tmp/on_off.log # Put your command to turn the light **on** here. fi

      You'd create that file (/Users/(your user)/on_off.sh for example) then make it executable with a command like this:

      chmod +x /Users/russ/on_off.sh

      Enable parameters on your command so TRIGGERcmd will add a on or off parameter to the command that runs the script via the TRIGGERcmd Smart Home Alexa Skill or Google Assistant Action.

      Your command would be the full path to the script, like this: /Users/russ/on_off.sh

    • Luiz Negrini

      Open Slack
      • Luiz Negrini

      1
      1
      Votes
      1
      Posts
      142
      Views

      No one has replied

    • Carlos CG

      Screenshot to clipboard
      • Carlos CG

      1
      1
      Votes
      1
      Posts
      139
      Views

      No one has replied

    • J

      onde consigo meu token de verificação??
      • joaoo

      2
      0
      Votes
      2
      Posts
      434
      Views

      Caue Santos

      @joaoo o token é todo o conteúdo em vermelho abaixo da linha escrito "Use this token when you install.....", pode verificar melhor na seguinte URL:
      https://www.triggercmd.com/user/computer/create

    • DAVID ALONZO

      Problems runing with mac
      • DAVID ALONZO

      2
      0
      Votes
      2
      Posts
      76
      Views

      Russ

      @DAVID-ALONZO, did you activate the TRIGGERcmd Smart Home skill? I recommend using it instead of the older TRIGGERcmd skill.

      https://www.triggercmd.com/forum/topic/538/using-the-alexa-smart-home-skill-the-first-time

      Also, what are you saying to Alexa?

    • Italo Rodrigues

      keyboard shortcuts
      • Italo Rodrigues

      2
      0
      Votes
      2
      Posts
      239
      Views

      Chabetico

      @Italo-Rodrigues No, because the file is executed in batch, that is, sequentially. I recommend doing it at AutoHotKey

    • Ricardo Machado

      Lock your screen Mac
      • Ricardo Machado

      8
      0
      Votes
      8
      Posts
      1324
      Views

      Daniel Garcia

      @Russ said in Lock your screen Mac:

      osascript -e 'tell app "System Events" to key code 12 using {control down, command down}'

      Gracias,ya me funciono