Jump to content

introducing alfred-outlookSuite 📬, a suite of tools to interact with Microsoft Outlook via Alfred


Recommended Posts

On 10/21/2023 at 1:09 AM, joshuadwagner said:

I just created a workflow that uses Applescript to switch folders in Outlook. @giovanni, If you (or anyone) would like to incorporate it into something else, you're welcome to do so. I'm afraid that this is about the extent of my abilities so I may not be of much help with issues.

https://github.com/joshuawagner/alfred-go-to-Outlook-folder/releases/latest

 

 

This is very good and useful. Thank you for sharing. 

 

Is it possible to also navigate to Groups or Smart Folders in similar manner?

Link to comment

Hi all,

 

get an error, has anybody an idea?

try to save an email...

 

 

[17:26:54.066] ERROR: Outlook Suite[Run Script] /Users/artur/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/12B7B6CB-AC11-4D0F-A5F7-F9D1D0F9D671:1517:1539: execution error: „Microsoft Outlook“ hat einen Fehler erhalten: „exchange account 1“ kann nicht gelesen werden. Ungültiger Index. (-1719)

Edited by artiman
Link to comment

Oh I finally figured it out. I never thought of using an Apple Script. 

Here it is if anyone wants to use it:
 

tell application "Microsoft Outlook"

activate

set theMainWindow to make new main window

set view of main window 1 to calendar view

end tell

Edited by 4tify
Link to comment
  • 2 months later...

So I have the same issue as @Marlouis. It almost feels like my instance of Outlook isn't "open" for this workflow to interact with. 

 

Here's the debug when I try -olk:

 

[09:04:45.496] Logging Started...
[09:04:49.324] Outlook Suite[Script Filter] Queuing argument '(null)'
[09:04:49.464] Outlook Suite[Script Filter] Script with argv '(null)' finished
[09:04:49.470] STDERR: Outlook Suite[Script Filter] [{'Name': 'RecentUnread', 'Query': 'to:me is:unread since:20'}]
0 days from last update
checking the JSON snoozer file...
The JSON file has been updated today.
[09:04:49.471] Outlook Suite[Script Filter] {"items": [{"title": "\u2b50Greetings", "subtitle": "1/8  [Placeholder_Drafts_Placeholder] From: None 2024-03-19 09:01 ", "valid": true, "quicklookurl": "", "variables": {}, "mods": {"control": {"valid": "true", "subtitle": "\ud83e\uddf5 filter entire thread", "arg": "Greetings", "variables": {"mySource": "thread", "threadTopic": "Greetings"}}, "shift": {"valid": "true", "subtitle": "\ud83d\udc40 show preview in large font", "arg": "Tuesday, March 19, 2024 09:01 AM\nFrom: None\nTo: None\n\nSubject: Greetings\n\nNone"}}, "icon": {"path": ""}, "arg": "/Users/AD66408/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/Messages/249/F9EC020D-C1B7-4CCA-882C-44C349BDB66B.olk15Message"}, {"title": "\u2b50Hello", "subtitle": "2/8  [Placeholder_Drafts_Placeholder] From: None 2024-03-18 16:20 ", "valid": true, "quicklookurl": "", "variables": {}, "mods": {"control": {"valid": "true", "subtitle": "\ud83e\uddf5 filter entire thread", "arg": "Hello", "variables": {"mySource": "thread", "threadTopic": "Hello"}}, "shift": {"valid": "true", "subtitle": "\ud83d\udc40 show preview in large font", "arg": "Monday, March 18, 2024 04:20 PM\nFrom: None\nTo: None\n\nSubject: Hello\n\nNone"}}, "icon": {"path": ""}, "arg": "/Users/AD66408/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/Messages/137/899F09C5-BFE6-4868-9D25-E4DD011E16AE.olk15Message"}, {"title": "\u2b50subject", "subtitle": "3/8  [Placeholder_Drafts_Placeholder] From: None 2024-03-18 16:14 ", "valid": true, "quicklookurl": "", "variables": {}, "mods": {"control": {"valid": "true", "subtitle": "\ud83e\uddf5 filter entire thread", "arg": "subject", "variables": {"mySource": "thread", "threadTopic": "subject"}}, "shift": {"valid": "true", "subtitle": "\ud83d\udc40 show preview in large font", "arg": "Monday, March 18, 2024 04:14 PM\nFrom: None\nTo: None\n\nSubject: subject\n\nNone"}}, "icon": {"path": ""}, "arg": "/Users/AD66408/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/Messages/15/0F3AFE4B-3DBF-4611-8339-62AB1D2ACFB1.olk15Message"}, {"title": "\u2b50Subject", "subtitle": "4/8  [Placeholder_Drafts_Placeholder] From: None 2024-03-18 16:14 ", "valid": true, "quicklookurl": "", "variables": {}, "mods": {"control": {"valid": "true", "subtitle": "\ud83e\uddf5 filter entire thread", "arg": "Subject", "variables": {"mySource": "thread", "threadTopic": "Subject"}}, "shift": {"valid": "true", "subtitle": "\ud83d\udc40 show preview in large font", "arg": "Monday, March 18, 2024 04:14 PM\nFrom: None\nTo: None\n\nSubject: Subject\n\nNone"}}, "icon": {"path": ""}, "arg": "/Users/AD66408/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/Messages/158/9E2D4DB6-5577-4F40-B00D-B5D4641B8D5D.olk15Message"}, {"title": "\u2b50Subject", "subtitle": "5/8 \ud83d\udcce [Placeholder_Drafts_Placeholder] From: None 2023-12-01 11:27 ", "valid": true, "quicklookurl": "", "variables": {}, "mods": {"control": {"valid": "true", "subtitle": "\ud83e\uddf5 filter entire thread", "arg": null, "variables": {"mySource": "thread", "threadTopic": null}}, "shift": {"valid": "true", "subtitle": "\ud83d\udc40 show preview in large font", "arg": "Friday, December 01, 2023 11:27 AM\nFrom: None\nTo: None\n\nSubject: Subject\n\nNone"}}, "icon": {"path": ""}, "arg": "/Users/AD66408/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/Messages/219/DBCBEA27-DEBF-4E16-8CFE-DDFBB6A6EA53.olk15Message"}, {"title": "\u2b50Subject", "subtitle": "6/8 \ud83d\udcce [Placeholder_Drafts_Placeholder] From: None 2023-10-19 16:30 ", "valid": true, "quicklookurl": "", "variables": {}, "mods": {"control": {"valid": "true", "subtitle": "\ud83e\uddf5 filter entire thread", "arg": null, "variables": {"mySource": "thread", "threadTopic": null}}, "shift": {"valid": "true", "subtitle": "\ud83d\udc40 show preview in large font", "arg": "Thursday, October 19, 2023 04:30 PM\nFrom: None\nTo: None\n\nSubject: Subject\n\nNone"}}, "icon": {"path": ""}, "arg": "/Users/AD66408/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/Messages/121/791B79A4-51BE-4A12-9974-BE4B461B1737.olk15Message"}, {"title": "\u2b50Subject", "subtitle": "7/8 \ud83d\udcce [Placeholder_Drafts_Placeholder] From: None 2023-10-11 13:48 ", "valid": true, "quicklookurl": "", "variables": {}, "mods": {"control": {"valid": "true", "subtitle": "\ud83e\uddf5 filter entire thread", "arg": null, "variables": {"mySource": "thread", "threadTopic": null}}, "shift": {"valid": "true", "subtitle": "\ud83d\udc40 show preview in large font", "arg": "Wednesday, October 11, 2023 01:48 PM\nFrom: None\nTo: None\n\nSubject: Subject\n\nNone"}}, "icon": {"path": ""}, "arg": "/Users/AD66408/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/Messages/183/B7F18553-8E71-401E-940C-9FAB6D39BF3B.olk15Message"}, {"title": "\u2b50Subject", "subtitle": "8/8 \ud83d\udcce [Placeholder_Drafts_Placeholder] From: None 2023-10-10 14:03 ", "valid": true, "quicklookurl": "", "variables": {}, "mods": {"control": {"valid": "true", "subtitle": "\ud83e\uddf5 filter entire thread", "arg": null, "variables": {"mySource": "thread", "threadTopic": null}}, "shift": {"valid": "true", "subtitle": "\ud83d\udc40 show preview in large font", "arg": "Tuesday, October 10, 2023 02:03 PM\nFrom: None\nTo: None\n\nSubject: Subject\n\nNone"}}, "icon": {"path": ""}, "arg": "/Users/AD66408/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/Messages/243/F3D66677-EB9C-459D-9387-E31898CC1C7D.olk15Message"}], "variables": {"mySource": "mailList"}}

 

And -em: 

 

[09:15:26.978] Outlook Suite[Keyword] Processing complete
[09:15:26.996] Outlook Suite[Keyword] Passing output 'Test' to Run Script

 

I hope you can take a look @giovanni

Edited by Dorv
Link to comment

@Dorv happy to help. A couple of questions:

first, can you confirm that you are using the older ('Legacy') version of Outlook?

second: are these real emails or tests? The first seems to be from 'None' to 'None' 

third: when you use `em`, do you get an error or is a draft created? 

Link to comment
  • 1 month later...

My search is not working and with debugger on I am getting this message

@giovanni can you please help me ?? I am using m1 mac on sonoma with outlook in legacy mode.

 

[12:09:25.084] Outlook Suite[Script Filter] Queuing argument '(null)'
[12:09:25.146] Outlook Suite[Script Filter] Script with argv '(null)' finished
[12:09:25.151] ERROR: Outlook Suite[Script Filter] Code 1: [{'Name': 'RecentUnread', 'Query': 'to:me is:unread since:20'}]
17 days from last update
Traceback (most recent call last):
  File "/Users/muhammadaqilsoomro/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.55038304-8A20-4C1A-9AB2-2659AF9982B4/main.py", line 420, in main
    myAccountKeys
UnboundLocalError: cannot access local variable 'myAccountKeys' where it is not associated with a value

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/muhammadaqilsoomro/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.55038304-8A20-4C1A-9AB2-2659AF9982B4/main.py", line 473, in <module>
    main()
  File "/Users/muhammadaqilsoomro/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.55038304-8A20-4C1A-9AB2-2659AF9982B4/main.py", line 422, in main
    myAccountKeys = fetchAccounts ()
                    ^^^^^^^^^^^^^^^^
  File "/Users/muhammadaqilsoomro/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.55038304-8A20-4C1A-9AB2-2659AF9982B4/main.py", line 41, in fetchAccounts
    with open(OUTLOOK_ACCOUNT_KEY_FILE, "r") as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/Users/muhammadaqilsoomro/Library/Application Support/Alfred/Workflow Data/giovanni-outlook/keyaccount.json'

Link to comment
Posted (edited)

@giovanni Thank you so much for your help it worked like a charm. This trick worked "Force refresh with outlook::refresh". Love you for your prompt response and help, I work all workday with Outlook mail, The Alfred app improved my workflow but this suite seems to propel my productivity. 

Edited by Aqil
addition
Link to comment

@giovanni Forgive me it's me again. Now I am trying to snooze email but am failing. I have created a "Snoozed" folder in the directory of the main mail account. Keeping Outlook as the main window and email open, when I give commands like olz 10 it's doing nothing. The snoozed folder is empty the email stays in my inbox. Here is the debugger report please see if you have time to help.

 

[08:25:49.918] Outlook Suite[Script Filter] Queuing argument '1'

[08:25:49.976] Outlook Suite[Script Filter] Script with argv '(null)' finished

[08:25:49.982] Outlook Suite[Script Filter] {"items": [

 

 

    {

        "title": "Snooze until Thursday May 16, 2024 (0)",

        "subtitle": "Snooze 1 day and Archive",

        "arg": "2024-05-16",

        "icon": {

"path": "icons/snooze.png"

}    

},

 

 

 

]}

[08:25:50.119] Outlook Suite[Script Filter] Queuing argument '10'

[08:25:50.173] Outlook Suite[Script Filter] Script with argv '(null)' finished

[08:25:50.181] Outlook Suite[Script Filter] {"items": [

 

 

    {

        "title": "Snooze until Saturday May 25, 2024 (0)",

        "subtitle": "Snooze 10 days and Archive",

        "arg": "2024-05-25",

        "icon": {

"path": "icons/snooze.png"

}    

},

 

 

 

]}

[08:25:51.441] Outlook Suite[Script Filter] Processing complete

[08:25:51.454] Outlook Suite[Script Filter] Passing output '2024-05-25' to Post Notification

[08:25:51.457] Outlook Suite[Script Filter] Passing output '2024-05-25' to Run Script

[08:25:51.673] ERROR: Outlook Suite[Run Script] 592:625: execution error: Microsoft Outlook got an error: Can’t get folder "Snoozed". (-1728)

Traceback (most recent call last):

  File "/Users/muhammadaqilsoomro/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.55038304-8A20-4C1A-9AB2-2659AF9982B4/snoozer.py", line 89, in <module>

    main()

  File "/Users/muhammadaqilsoomro/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.55038304-8A20-4C1A-9AB2-2659AF9982B4/snoozer.py", line 62, in main

    myOutput = check_output(command).decode('utf-8').strip()

               ^^^^^^^^^^^^^^^^^^^^^

  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 466, in check_output

    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run

    raise CalledProcessError(retcode, process.args,

subprocess.CalledProcessError: Command '['osascript', '-e', '\n        tell application "Microsoft Outlook"\n            \n            activate\n            \n            if view of the first main window is not equal to "mail view" then\n                set view of the main window 1 to mail view\n                \n            end if\n            \n            set msgSet to selection\n            \n            set myIDs to {}\n            \n            repeat with aMessage in msgSet\n                \n                set msgID to id of aMessage # getting regular ID (which is different across computers)\t\t\n                set end of myIDs to msgID\n                move aMessage to folder "Snoozed"\n                \n                \n                \n            end repeat\n            \n        end tell\n\n        set AppleScript\'s text item delimiters to ":::"\n        set myIDs to myIDs as text\n        set AppleScript\'s text item delimiters to ""\n        return myIDs\n        \n    end run ']' returned non-zero exit status 1.

Link to comment

In addition, the command "ols" is not saving email in a folder Downloads. Here is the Debugg report

 

 

[08:39:08.268] Outlook Suite[Keyword] Processing complete

[08:39:08.278] Outlook Suite[Keyword] Passing output '' to File Filter

[08:39:14.727] Outlook Suite[File Filter] Processing complete

[08:39:14.736] Outlook Suite[File Filter] Passing output '/Users/muhammadaqilsoomro/Downloads' to Post Notification

[08:39:14.737] Outlook Suite[File Filter] Passing output '/Users/muhammadaqilsoomro/Downloads' to Run Script

[08:39:15.003] ERROR: Outlook Suite[Run Script] /Users/muhammadaqilsoomro/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/7E5C2540-57B8-495D-AABA-6AC9795969CE:941:948: execution error: The variable dateObj is not defined. (-2753)

[08:39:15.011] Outlook Suite[Run Script] Processing complete

[08:39:15.013] Outlook Suite[Run Script] Passing output '' to Run Script

[08:39:15.097] Outlook Suite[Run Script] Processing complete

[08:39:15.103] Outlook Suite[Run Script] Passing output '(file://)

' to Replace

[08:39:15.105] Outlook Suite[Replace] Processing complete

[08:39:15.106] Outlook Suite[Replace] Passing output '(file://) ' to Run Script

[08:39:15.193] Outlook Suite[Run Script] Processing complete

[08:39:15.203] Outlook Suite[Run Script] Passing output '(file://)

' to Copy to Clipboard

Link to comment
  • 1 month later...

My search is showing results but when I try to open an email from Search it just brings Outlook to the front. When I try to Draft an email nothing happens but now I have 4 emails named test in my search results but they are not in Outlook Drafts. I think it might be an account issue. Here is debug logs from Alfred:

 

"18/12767791-8A16-4842-9933-7EBFB553B5E4.olk1 [truncated]
[12:10:02.404] Outlook Suite[Script Filter] Processing complete
[12:10:02.448] Outlook Suite[Script Filter] Passing output '/Users/divincem/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/Messages/204/CC7B9AD5-41A7-4A19-938D-420D0CA49356.olk15Message' to Conditional
[12:10:02.449] Outlook Suite[Conditional] Processing complete
[12:10:02.450] Outlook Suite[Conditional] Passing output '/Users/username/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/Messages/204/CC7B9AD5-41A7-4A19-938D-420D0CA49356.olk15Message' to Open File"

 

 

 

image.thumb.png.afa92aa17b1a42cfee1e861da3800901.png

Link to comment
  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...