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

    Trigger a command with a Shortcut via Siri

    Mac
    2
    3
    878
    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.
    • RussR
      Russ
      last edited by Russ

      You can run commands on your computers with Siri using a Shortcut. Here's how:

      1. Download the Shortcuts app on your iOS device.

      2. Open this link or scan this QR code from your iOS device:
        triggercmd_ios_shortcut_qr_code.png

      3. Fill in the computer, trigger, and token fields. The params field is optional.

      4. In the shortcut's settings, tap "Add to Siri" and record your personal phrase.

      triggercmd_ios_shortcut.jpg

      Here's a Youtube video showing how it works:
      https://youtu.be/YBOiWBokal8

      Russell VanderMey

      1 Reply Last reply Reply Quote 0
      • RussR Russ referenced this topic on
      • RussR Russ pinned this topic on
      • G
        gajahduduk
        last edited by gajahduduk

        hi -- how can this be used to display or say the result?

        here's a command that works on alexa:

        osascript -e 'tell application "Music" to set result to "This song is " & name of current track & " by " & artist of current track & " on the " & year of current track & " album " & album of current track' | sed 's/^/"/;s/$/"/' | xargs -I{} ~/.TRIGGERcmdData/sendresult.sh {}
        

        when created with the QR code, the last step is "Get contents of TEXT". result: nothing. I added "Show result <contents of URL>" (defaults to that parameter). result: "no authorization header was found".

        RussR 1 Reply Last reply Reply Quote 0
        • RussR
          Russ @gajahduduk
          last edited by

          @gajahduduk said in Trigger a command with a Shortcut via Siri:

          osascript -e 'tell application "Music" to set result to "This song is " & name of current track & " by " & artist of current track & " on the " & year of current track & " album " & album of current track' | sed 's/^/"/;s/$/"/' | xargs -I{} ~/.TRIGGERcmdData/sendresult.sh {}

          Can you help me get started? I tried your command it doesn't seem to work. Is there something I need to do in the Music app first?

          russ@macbook-air ~ % osascript -e 'tell application "Music" to set result to "This song is " & name of current track & " by " & artist of current track & " on the " & year of current track & " album " & album of current track'
          60:64: execution error: Can’t make name of «class pTrk» of application "Music" into type Unicode text. (-1700)
          

          Russell VanderMey

          1 Reply Last reply Reply Quote 0
          • First post
            Last post