Jump to content

apple messages in alfred

Recommended Posts

I currently use this contact query. (screenshot below) When i search for a contact within alfred -- i select their number and it focuses me on the message field where i can type directly into that field. I'm wondering if there is a way to build a worklfow where i can also type the message as a variable and also have it send to that contact. There is this applescript....



tell application "Messages"

set targetBuddy to "(XXX) XXX-XXXX"

set targetService to id of 1st account whose service type = iMessage

set textMessage to "test"

set theBuddy to participant targetBuddy of account id targetService

send textMessage to theBuddy

end tell



Is there a way to use the custom contact action in a workflow to pass the number to that script -- and i can use another keyword to pass the message to into a variable that also hits that script? I just don't want to leave alfred to send the message if it is a contact i have to send regular messages to





Edited by sepulchra
Link to comment

Although this is not the complete answer to your problem I think it can be done because I've done something similar. In effect what you need to do is to save both the number and the message as separate variables in the workflow (just use a keyword action for the message without any keyword) and then pass to Messages a URL like imessage://{var:recipient}&body={var:theMessage}.



Link to comment

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...