Stephen_C Posted April 2, 2023 Posted April 2, 2023 Inspired by this thread to revisit an old, poorly written workflow of mine, this workflow is designed to send a message (using the Messages app) to a selected contact. I have called it a "template workflow" because you have to do some work in order to make it work. (The workflow has no dependencies other than relying on the Messages app and a little AppleScript.) The List Filter is populated with some names and numbers (and I apologise if your name is among them—but don't worry, it's not your number). It looks like this: Note the format of the Arg for the name. When you add a name that is the format you should follow: name,number (i.e., separarated only by a comma). All you need to do is to substitute details of your contacts for the names given in the List Filter. Simply follow the format used in the initial list.Usage The workflow will prompt you: to choose from your pre-populated list of contacts; and then for the text of a message to send via the Messages app. It then sends the message and quits the app. GitHub download link Stephen cands 1
sepulchra Posted April 2, 2023 Posted April 2, 2023 (edited) @Stephen_C well this is very nice! You can take or leave this suggestion, but any reason not to just use the "messages" icon? That icon, to my mind, implies it sends emails.... just a quick thought. Thank you for puzzling over that other thread. Edited April 2, 2023 by sepulchra
Stephen_C Posted April 2, 2023 Author Posted April 2, 2023 @sepulchra thanks for the comment—which is entirely justified. Frankly, icons have always been a curse for me: I seem to spend more time trying to find appropriate icons than I do writing the workflows (in spite of the usefulness of https://font2png.com/). I did get the impression that, in a kindly way, @vitor tried to dissuade me from using macOS app icons for workflows—even if those workflows relied on that app. I may, of course, be wrong about that! My own copy of this workflow naturally uses the Messages app icon. 😀 I'll cast around and see if I can find some better icon for the GitHub workflow. Stephen
sepulchra Posted April 2, 2023 Posted April 2, 2023 (edited) I can understand ... maybe the icon called "comment-dots" at font2png might call to mind messages a bit more? Again just my 2-cents. Please stick with your original if you don't think so! Edited April 2, 2023 by sepulchra
Stephen_C Posted April 3, 2023 Author Posted April 3, 2023 (edited) Version 1.01: icon changed. Edit: …with no offence intended by using another idea! Stephen Edited April 3, 2023 by Stephen_C sepulchra 1
dood Posted April 3, 2023 Posted April 3, 2023 Cool workflow! I'm getting the following error in 10.15 Catalina: script error: Expected end of line, etc. but found identifier. (-2741) Can the workflow send messages to email addresses (i.e. people with Android phones)?
Stephen_C Posted April 3, 2023 Author Posted April 3, 2023 11 minutes ago, dood said: I'm getting the following error in 10.15 Catalina: script error: Expected end of line, etc. but found identifier. (-2741) I'm sorry, I'm on Ventura and can't reproduce that error. If you know how to do it one way to find out a little more would be to run the script in Script Editor. Try copying and pasting this into Script Editor: set targetFriend to "+123456789123" set textMessage to "This is a test message" tell application "Messages" set targetService to (id of 1st account whose service type = iMessage) set theFriend to participant targetFriend of account id targetService send textMessage to theFriend end tell Click on the three lines at the right end of the status bar at the bottom of the Script Editor window—that will split the screen horizontally. Run the script and let me know if there's anything more specific by way of an indication of where the error is. You may have to click between the various window options on the divider bar in Script Editor. 20 minutes ago, dood said: Can the workflow send messages to email addresses (i.e. people with Android phones)? No—because it's specifically looking for people who are registered with the Apple Messages service. Stephen
Stephen_C Posted April 3, 2023 Author Posted April 3, 2023 (edited) 2 hours ago, dood said: I'm getting the following error in 10.15 Catalina: script error: Expected end of line, etc. but found identifier. (-2741) You could also try replacing the following lines in the Run Script action of the workflow: set targetService to (id of 1st account whose service type = iMessage) set theFriend to participant targetFriend of account id targetService with these lines: set targetService to 1st service whose service type = iMessage set theFriend to buddy targetFriend of targetService So far as I can discover there seems to have been a change in the AppleScript programming of Messages between macOS Catalina and macOS Ventura but I am rather working in the dark, I'm afraid! Stephen Edited April 3, 2023 by Stephen_C Removed redundant definite article in text!
Stephen_C Posted April 3, 2023 Author Posted April 3, 2023 @dood I have amended the script in the workflow as indicated in this post because it has no adverse effect on the workflow in Ventura. I'm rather hoping it will overcome your problem so if you fancy trying version 1.1 of the workflow this is the GitHub download link. If you do try it please let me know how you get on. Stephen
Stephen_C Posted April 4, 2023 Author Posted April 4, 2023 I'm so pleased @dood. Many thanks for your report. Stephen
Stephen_C Posted April 4, 2023 Author Posted April 4, 2023 Version 1.11 released: a minor update simply to reflect the new icon in the images within the User Configuration. Thanks to @dood for help in ensuring this should now work with older versions of macOS. Stephen dood 1
Stephen_C Posted April 20, 2023 Author Posted April 20, 2023 Version 1.12: simply changed the icon colours in recognition of problems posed by previous one for those who may be green/blue colour blind. Sorry if you were affected! Stephen
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