I've been using the script below in conjunction with a Streamdeck for some time. Suddenly it no longer works. As far as I know, I have made no changes.
Could someone look at it and tell me if it should work? I'm sure I downloaded it from here originally and made minor changes. Thanks.
tell application "Mail"
set selMessage to selection
set thisMessage to item 1 of selMessage
set mailbox of thisMessage to mailbox "Waiting" of account "**account name**"
display notification with title "Message Moved to Waiting Folder"
Just to confirm, your personal copy of the script does contain an actual account name, correct? I'm assuming you put in **account name** for privacy purposes here?
I just ran this on my end and after supplying an account name it works for me.
Do you reference the AppleScript via a file path in the Stream Deck app? Just yesterday I realized the reason several of my buttons stopped working was because I had moved some files around and the Stream Deck could no longer find the AppleScript files from the file path I had previously supplied.
That’s probably the issue. I like KM Link but from time to time they stop working and I have to replace the button. No clue why, but I’ve come across others online who have the same issue occasionally. Try these in the following order to rule out an issue with Stream Decks plugin.
Reselecting the macro in the KM Link dropdown menu.
Copying the button and pasting to another location, then running it from there.
This sounds fishy. All caps are mine. Should that be something like MESSAGE, rather than ACCOUNT? That is, shouldn't it be trying to set the mailbox of a message, rather than the mailbox of an account. Does that make any sense?
Just to close this properly - the issue is fixed. I was using that mail account to send and receive with no problems but later noted that things like random selection of signatures and setting this account as the default reply account were not working correctly. In the end I deleted the account and re-entered the details. It all appears to work correctly now including the AppleScript. I assume that for some reason the script couldn’t see the account as it was corrupted in some way. Thanks for all the input.