Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emails won't move to the selected folder #1

Open
AxelCorjon opened this issue Feb 21, 2023 · 7 comments
Open

Emails won't move to the selected folder #1

AxelCorjon opened this issue Feb 21, 2023 · 7 comments

Comments

@AxelCorjon
Copy link

Hi,

This is my first time using Alfred (and I haven't used apple script in a long time). But the script doesn't work for me :/

  • I configured a hotkey in Alfred
  • I can summon the interface and the email account folders are listed
  • When selecting a folder and hitting enter, nothing happens :/

I'm on macOS 13.1 and it's in French (a long time ago it was an issue with apple script, I don't know if it still is).

Could you help me?

@AxelCorjon AxelCorjon changed the title Doesn't work :/ Emails won't move to the selected folder Feb 21, 2023
@odapg
Copy link

odapg commented May 16, 2023

I believe that this is due to Mail having a different menu layout in Ventura.
Try to change "menu item 18" with "menu item 21" in the final "Run script" action.

@ldebritto
Copy link
Owner

I've changed the AppleScript of the second step on the workflow to a more straightforward move command. However, I'm still having trouble dealing with Gmail Accounts.

I guess I will keep an eye on how one could use both account and mailbox names in the menu approach, as it used to work even with Gmail accounts.

@Blog404DE
Copy link

I've changed the AppleScript of the second step on the workflow to a more straightforward move command. However, I'm still having trouble dealing with Gmail Accounts.

I guess I will keep an eye on how one could use both account and mailbox names in the menu approach, as it used to work even with Gmail accounts.

... and i even had trouble with every Account (one IMAP and one Exchange-Account). I've testet it under Ventura and Sonoma (current Version / Language set to: German) and it didn't move any Mail :-/

@odapg
Copy link

odapg commented Dec 29, 2023

@Blog404DE
I had the same problem. In "move command.applescript", I replaced the line
set mailbox of theMessage to theMailbox
with
move theMessage to theMailbox
(and put the line set theMailbox to mailbox mailboxName of account theAccount before of the repeat loop), and now it works fine.

@Blog404DE
Copy link

@odapg
hmm, i've changed the script to the following code:

on run argv
	tell application "Mail"
		try
			set mailboxName to item 1 of argv
			set theAccount to item 2 of argv
			if selection is {} then error
			set messageList to (selection as list)
			set theMailbox to mailbox mailboxName of account theAccount
			repeat with theMessage in messageList
				-- set theMessage to the first item of (selection as list)
				set theMailbox to mailbox mailboxName of account theAccount
				move theMessage to theMailbox
			end repeat
		end try
	end tell
end run

But it still didn't move any E-Mails and i have absolutely no idea how to debug a AppleScript inside of Alfred :-(

@odapg
Copy link

odapg commented Dec 30, 2023

@Blog404DE
Hmm. On my side it even works with my gmail account (on Sonoma 14.2.1).
Actually, my personal version is also modified at the level of the other applescript, in order to make it independent of JSON Helper.
So: I forked @ldebritto's project, and put my complete version on this fork. Perhaps can you give it a try? If it works, I could propose to @ldebritto to merge it (and this would probably mean that the problem comes from JSON Helper).

@Blog404DE
Copy link

thx :-) ... I've tried it with the same result. But i've found a option to debug my problem.

With activating the debugging mode in alfred, i've could created some log-Outputs. The first part of the script (creating a list auf mailboxes) is working without any problem (with your version) and i've testet the second script and it seems, the Problem started with the line:
set theMailbox to mailbox mailboxName of account theAccount
After this line, the script stopped and log "Debug-Point" didn't output anything inside Alfred's debugger. A debug output in the line directly in front of it, however, is still displayed and "mailboxName" / "theAccount" contains the correct information.

Maybe i've got time to dig deeper into the problem next year ... ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants