Jimmy Posted January 16, 2021 Share Posted January 16, 2021 Greetings - I am an unsophisticated user of automation that has gotten lucky over the years in finding AppleScripts that have done a crucial workflow for me - creating a task in Things with a URL that opens a specific Outlook message. As versions of MacOS and Outlook have changed, I've had to adapt, but not by knowing how it all works, but getting lucky and Googling something that does. With a new M1 Mac and the latest updates to Automator I appear to be at a dead end. What I'd like is for Alfred to be able to run the following script successfully. Whenever I try to do it by copying and pasting the below into an NSAScript object in a workflow, it basically does nothing at all. I suspect I'm one or two tips away from getting this previously successful script to work, but I don't know how. In my old setup I used this script to create a service in MacOS, now I can't. I'm hoping Alfred can help me bridge the gap but I don't know how to do it. Any assistance would be appreciated. on run {input, parameters} tell application "Microsoft Outlook" set selectedMessages to selected objects if selectedMessages is {} then display notification "Please select a message in Outlook before running the script!" else set messageId to id of item 1 of selectedMessages set uri to "outlook://" & messageId set theSubject to the subject of item 1 of selectedMessages set theSender to the sender of item 1 of selectedMessages set theName to the name of theSender end if end tell tell application "Things3" show quick entry panel with properties {name:theSubject, notes:"From: " & theName & return & "Subject: " & theSubject & return & "Link: " & uri} end tell return input end run Link to comment
deanishe Posted January 16, 2021 Share Posted January 16, 2021 Hi @Jimmy, welcome to the forum. 4 hours ago, Jimmy said: Whenever I try to do it by copying and pasting the below into an NSAScript object in a workflow I'm afraid you can't just paste an Automator script into another program. Automator scripts work a specific way. Put your script in a Run Script action (not Run NSAppleScript) with Language = “/usr/bin/osascript (AS)” and change on run {input, parameters} to on run(argv) Link to comment
Jimmy Posted January 16, 2021 Author Share Posted January 16, 2021 Thank you very much. That caused me to be able to get the expected behavior from the script. Unfortunately, however, the purpose of the script seems defeated. I'll share that here in case you or someone else might know something about why. it seems that the M1 version of either MacOS or Outlook now no longer allow the hyperlink that the script creates to open the message with the URI that the script fetches from Outlook and embeds in the hyperlink. When attempting to use the link created by the script, MacOS returns a message stating "There is no application set to open the URL outlook://143755." When I attempt to manually configure the URL to be opened by Outlook it gives a warning stating "It is not known whether this application can open "outlook://1437555." At this point I'm guessing that this is a problem for Microsoft or Apple, but if you know differently I'm all ears and, in any case, thanks for your help to this point! Link to comment
deanishe Posted January 16, 2021 Share Posted January 16, 2021 (edited) If macOS says Outlook can’t open outlook:// URLs, that means the Outlook application doesn’t declare that it can open them. That probably means that it can’t. Edited January 16, 2021 by deanishe Link to comment
Jimmy Posted January 16, 2021 Author Share Posted January 16, 2021 I thought that might be the case. This would appear to be a difference between the current versions of Outlook for MacOS on Intel versus M1, as it still works on the Intel machine I'm moving from but not on the M1 machine I'm moving to. Thanks for the help - much appreciated. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now