samknight / slack_applescript

AppleScript bundle for Slack methods
275 stars 20 forks source link

Status command sometimes malforms #22

Closed hdehal closed 3 years ago

hdehal commented 3 years ago

Hello -- thanks for this amazing Applescript!

Occasionally, it seems that Slack malforms the /status command as /s. atus which then results in an error:

image

Here is my full Applescript:

repeat
    if application "Spotify" is running then
        tell application "Spotify"
            set currentSong to (get artist of current track) & " – " & (get name of current track)
            tell script "Slack"
                set status currentSong with icon ":headphones:"
            end tell
        end tell
    end if
    delay 60
end repeat

However, if I close and restart Slack, the Apple script will work (just once). Subsequent attempts results in the malformed status.

Would appreciate your guidance here if you're able to shed some light, perhaps a mistake in my syntax -- thank you!

samknight commented 3 years ago

Hi I think this may have been fixed in the latest 2.0.2 version. Could you give it a try and let me know?

hdehal commented 3 years ago

Thank you @samknight -- the issue appears fixed!