Thanks for your answer! @appleianer
Here is the screenshot of the action and the error message:
The github version date downloaded and installed
By the way, I'm using Keyboard Maestro 8.2.4 version
And this is the way my .scpt looks like after I changed the keys (I tried to put the keys between quotes and without and I'm having the same error result):
-- PO_UserKey is the User Key listed on the page after you login, can also be a group key
set PO_UserKey to ufpaqjvcbvphg7ufix2uf883gnwips
-- PO_Token is the application token from the appliation created on the Pushover site
set PO_Token to ak2wucr9gqdbihhasff2o3wxfejf9v
-- PO_APIURL is the url to post the notification too
set PO_APIURL to "https://api.pushover.net/1/messages.json"
-- fetch settings from Keyboard Maestro
tell application "Keyboard Maestro Engine"
-- look up action parameters in Keyboard Maestro
set Priority to system attribute "KMPARAM_Priority"
set Title to system attribute "KMPARAM_Title"
set UrlStr to system attribute "KMPARAM_URL"
set UrlTitle to system attribute "KMPARAM_URL_Title"
set Message to system attribute "KMPARAM_Notification_Message"
set AlertSound to system attribute "KMPARAM_Notification_Sound"
set FileAttachment to system attribute "KMPARAM_File_Attachment"
end tell
if ((length of UrlTitle ≥ 14) and ((text 1 thru 14 of UrlTitle) is "Optional title")) then
set UrlTitle to ""
end if
if ((length of UrlStr ≥ 12) and ((text 1 thru 12 of UrlStr) is "Optional URL")) then
set UrlStr to ""
end if
if ((length of FileAttachment ≥ 13) and ((text 1 thru 13 of FileAttachment) is "Optional file")) then
set FileAttachment to ""
end if
-- turn notification nice names to api names ("Piano Bar" -> "pianobar")
set AlertSound to do shell script "echo " & quoted form of (AlertSound) & " | tr A-Z a-z"
set AlertSound to remove_spaces(AlertSound)
if AlertSound is "pushoverecho" then
set AlertSound to "echo"
else if AlertSound is "alienalarm" then
set AlertSound to "alien"
end if
-- Use in debugging, can run without KM
--set Priority to "Normal"
--set Title to "Test Title"
--set Message to "Test Message"
--set AlertSound to "User Default"
if Priority is "Normal" then
set PO_Priority to 0
else if Priority is "High" then
set PO_Priority to 1
else if Priority is "Low" then
set PO_Priority to -1
else
set PO_Priority to -2
end if
-- build curl command line
set curl to "curl -s "
set curl to curl & "--form-string "token=" & PO_Token & "" "
set curl to curl & "--form-string "user=" & PO_UserKey & "" "
set curl to curl & "--form-string "title=" & Title & "" "
set curl to curl & "--form-string "html=1" "
set curl to curl & "--form-string "message=" & Message & "" "
set curl to curl & "--form-string "priority=" & PO_Priority & "" "
set curl to curl & "--form-string "sound=" & AlertSound & "" "
if length of UrlStr > 0 then
set curl to curl & "--form-string "url=" & UrlStr & "" "
set curl to curl & "--form-string "url_title=" & UrlTitle & "" "
end if
if length of FileAttachment > 0 then
set curl to curl & "-F "attachment=@" & FileAttachment & "" "
end if
set curl to curl & PO_APIURL
-- make it so
do shell script curl
-- subroutine to remove spaces
on remove_spaces(the_string)
set AppleScript's text item delimiters to space
set the item_list to every text item of the_string
set AppleScript's text item delimiters to ""
set the_string to the item_list as string
return the_string
end remove_spaces