TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. gajahduduk
    G
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 15
    • Best 0
    • Controversial 0
    • Groups 0

    gajahduduk

    @gajahduduk

    0
    Reputation
    5
    Profile views
    15
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    gajahduduk Unfollow Follow

    Latest posts made by gajahduduk

    • RE: Trigger a command with a Shortcut via Siri

      @Russ brilliant! yes, I had made sendresult.sh executable previously. but the response change made parsing the result easier as you say. other stumbling blocks fixed:

      • the trigger value in the shortcut configuration needed a "%20" instead of a space, as the command name had a space!
      • the value for "computer" has to be the actual computer name in TriggerCMD, not laptop or maclaptop etc. (DUH).
      • then what I needed in the first steps of the shortcut was this:

      IMG_8902.jpg

      … etc. (you need to work with the variable "dictionary value" in this case.)

      posted in Mac
      G
      gajahduduk
    • RE: Crashing & translocation & ARM

      @Russ FYI, the ARM version (1.0.45) is now working. I had tried at least one update of the ARM version since I originally posted this, and it too crashed. given I was working with TC yesterday I tried again. whatever you did and whenever you did it, thanks.

      posted in Mac
      G
      gajahduduk
    • RE: Alexa Plus

      @Russ I look forward to you getting it worked out. needless to say, thank you enormously for your contribution and continuing efforts.

      I have both the Smart Home skill and the original Trigger Command skill installed. That hadn't been a problem, should it be?

      I do of course have a specific use-case: much of what I want to do (such as getting info on the current music playing) requires the output, not just an on / off switch.

      I wonder if it is possible to add that functionality to the new skill?

      posted in Alexa
      G
      gajahduduk
    • RE: Trigger a command with a Shortcut via Siri

      @Russ i think your Music app's player state is stopped. play a track, or play one and pause it, and it should work. (mine is never stopped :).

      to test the basic functionality leave out the last pipe part (" | xargs" …), and run the rest in Terminal.

      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/$/"/'
      

      as noted, this works for the "original" Alexa. Since I've been having problems with Alexa Plus and TriggerCMD, I was trying the Shortcuts route.

      posted in Mac
      G
      gajahduduk
    • Alexa Plus

      Recently upgrade to "Alexa Plus". now the "old" method command "alexa ask trigger command to run…" results in alexa saying:

      "trigger command isn't supported on alexa plus yet. you can still access it on the alexa app under skills and games"

      is this a known issue?

      edit: apparently it sometimes works as expected, and sometimes doesn't (with above response)

      posted in Alexa
      G
      gajahduduk
    • RE: Trigger a command with a Shortcut via Siri

      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".

      posted in Mac
      G
      gajahduduk
    • RE: Alexa report What Artist & What Song in Music

      IMPORTANT NOTE on above

      you must make the sendresult.sh bash script executable. go to terminal and:

      cd ~/.TRIGGERcmdData/
      chmod +x sendresult.sh
      
      posted in Mac
      G
      gajahduduk
    • RE: Crashing & translocation & ARM

      @Russ Hi. Thank you for attempting this. Sorry I had no email notifications turned on, so didn't get this until today.

      Just tried it, there seem to be gatekeeper issues.

      alt text

      normally I can bypass this with a terminal command called xattr. However in this case even that doesn't work.

      usually this has to do with lack of code signing the executable.

      i reinstalled the x64 version and got this, which is expected, and after confirming it launched. note that I did not need to use xattr on this one, but maybe I had previously?

      (Prior to this, today, while adding some new actions, it crashed more than once.)

      alt text

      posted in Mac
      G
      gajahduduk
    • Alexa report What Artist & What Song in Music

      I wanted Alexa to be able to report what is playing in (Apple) Music. I came up with these, which I am delighted to say, work:

      WHAT ARTIST

      osascript -e 'tell application "music" to set result to artist of current track' | sed 's/^/"/;s/$/"/' | xargs -I{} ~/.TRIGGERcmdData/sendresult.sh {}
      

      Voice: what artist
      Voice Reply: This artist is {{result}}

      WHAT SONG

      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 {}
      

      Voice: what song
      voice reply: {{result}}

      Note: I'm not a terminal wiz, I'm not sure if this is the most efficient way to do this (happy for suggestions), but it works. the "sed" part is just to quote the result from "Music"

      Of course you have to enable the Trigger Command Alexa skill. So you'd say:

      "Alexa, ask Trigger Command to run What Song" or "…What Album"

      BONUS: NEXT ALBUM

      and now that I was on a roll, I tried something more complicated that needs to run an applescript file, playing a new album in the current playlist:

      osascript ~/Library/Scripts/Applications/Music/commands/next.album.scpt | sed 's/^/"/;s/$/"/' | xargs -I{} ~/.TRIGGERcmdData/sendresult.sh {}
      

      voice: Next Album
      voice reply: {{result}}

      applescript:

      tell application "Music"
      	set rcount to 0
      	set talb to album of current track
      	repeat
      		set rcount to rcount + 1
      		next track
      		set newalbum to album of current track
      		set newartist to artist of current track
      		if newalbum is not talb or rcount > 30 then exit repeat
      	end repeat
      	set result to "Playing " & newalbum & " by " & newartist
      end tell
      

      (saved as "next.album.scpt" and saved to path as given above. of course you can rename and/or change the path. the count is just a fail safe if album has too many tracks, can change of course)

      posted in Mac
      G
      gajahduduk
    • RE: Cannot trigger any command (SmartHome / Mac)

      @Russ thanks. i did not delete it. i came in hot as a newbie, made minimal changes. some error there, or maybe had to do with the crash.

      also purely on a side note, I made the voice command "mac music" and it worked, to my surprise. Both Siri and Alexa are very aggressive in interpretting anything having to do with music (tunes, jukebox, songs, etc.) as an intent to play random shit from their poor cloud services.

      posted in Alexa
      G
      gajahduduk