• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
TRIGGERcmd
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Running shortcuts on Mac OS

Mac
2
8
1.1k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A
    admreece
    last edited by Jan 8, 2022, 9:13 PM

    Hi there.

    I'm trying to see if I can run a Mac OS shortcut using TriggerCMD with a voice command via Alexa.

    So far I have not managed to get this working properly and need some help.

    I have created a command using the GUI editor and I have used the command: shortcuts run agency

    (agency is the name of my shortcut which opens two apps)

    If I run the command directly from the GUI command editor, the shortcut doesn't run until I close the GUI and then open it again? This seems strange as this does not happen with the sample Calculator command?

    I have tried using the same command (shortcuts run agency) in Mac OS Terminal and it works immediately.

    What am I doing wrong?

    Thanks in advance.

    R 1 Reply Last reply Jan 9, 2022, 5:54 PM Reply Quote 0
    • R
      Russ @admreece
      last edited by Jan 9, 2022, 5:54 PM

      @admreece, you'll have to get me started. I'm unfamiliar with this shortcuts command.

      I found this app, but it's only for iOS devices.
      https://apps.apple.com/app/shortcuts/id915249334

      How do I get that shortcuts command on my mac?

      Russell VanderMey

      A 1 Reply Last reply Jan 10, 2022, 9:07 PM Reply Quote 0
      • A
        admreece @Russ
        last edited by Jan 10, 2022, 9:07 PM

        @russ hey there, thanks for responding.

        I'm sure you know that to get shortcuts on your mac you need to be running MacOS Monterey.

        Because I read that TriggerCMD commands use the same format as what can run from the command line, I did a Google search for how to run shortcuts from the command line and the following is what I found: https://sixcolors.com/post/2021/12/run-shortcuts-from-the-mac-command-line/

        As I previously mentioned, if you type: shortcuts run followed by the name of your shortcut, the Mac will run that shortcut.

        In my case this would be: shortcuts run agency

        (agency being the name of my shortcut).

        R 1 Reply Last reply Jan 10, 2022, 9:59 PM Reply Quote 0
        • R
          Russ @admreece
          last edited by Russ Jan 10, 2022, 10:00 PM Jan 10, 2022, 9:59 PM

          @admreece, I didn't know I needed Monterey to run shortcuts, but I do now thanks to you.

          For some reason my mac won't let me upgrade to Monterey, so now I have a nice excuse to shop for a new mac.

          In the meantime, I suggest running this command to find the full path to the shortcuts command:

          which shortcuts
          

          Then use that full path in your TRIGGERcmd command like this (assuming the folder is /usr/bin):

          /usr/bin/shortcuts agency
          

          If that doesn't work, you could try making a agency.scpt apple script like that link suggested:

          tell application "Shortcuts Events"
              set theResult to run shortcut "agency"
          end tell
          

          You could run that script with a command like this:

          /usr/bin/osascript ~/agency.scpt
          

          Russell VanderMey

          A 2 Replies Last reply Jan 11, 2022, 9:01 AM Reply Quote 0
          • A
            admreece @Russ
            last edited by Jan 11, 2022, 9:01 AM

            @russ Many thanks, I've just tried using the full path option and the same thing happens as before, the command only works when I quit out of the HUI and then open it again. I will try the Apple Script option next.

            1 Reply Last reply Reply Quote 0
            • A
              admreece @Russ
              last edited by Jan 11, 2022, 9:44 PM

              @russ OK, I've got this to work thanks to your help.

              I created an AppleScript as described and added the path into the GUI command field.

              Now I can ask Alexa to run shortcuts and it works perfectly!!

              Now another challenge. Can I somehow run the TriggerCMD command using an Alexa Routine, rather than using my voice command?

              So for example I already have a routine that runs when I say "Alexa good morning" that turns on my office light, turns on my radiator and reads out my calendar for the day. I'd like to add the TriggerCMD command to this routine. Is that possible?

              R 1 Reply Last reply Jan 12, 2022, 2:24 AM Reply Quote 0
              • R
                Russ @admreece
                last edited by Jan 12, 2022, 2:24 AM

                @admreece, definately. A lot of TRIGGERcmd users use routines to run their commands.

                In your Alexa Routine under "When this happens" select "Smart Home" then pick your command.

                This video shows some screenshots. It also shows how you can run a routine when you run one of your commands.

                Russell VanderMey

                A 1 Reply Last reply Jan 12, 2022, 10:49 PM Reply Quote 0
                • A
                  admreece @Russ
                  last edited by Jan 12, 2022, 10:49 PM

                  @russ many thanks, I’ll take a look.

                  1 Reply Last reply Reply Quote 0
                  • F Frank Grubb referenced this topic on Apr 5, 2023, 10:11 PM
                  1 out of 8
                  • First post
                    1/8
                    Last post