Automation - task with information from text message on ios

Hi,
Does anyone know if there’s a way to automatically create tasks with informartions extracted from text messages? Seems unlikely given how protective Apple is with text message but maybe there’s some RubeGoldberg machine-esque trick to do this?

1 Like

I would investigate whether you can get enough information into a shortcut triggered from the share sheet in Messages.

Having recently written a shortcut that creates an OmniFocus task in a project, with a URL as a note, I know the Shortcuts piece of this works. OmniFocus had very nice shortcuts support - for this scenario.

I have no experience of trying to trigger from the share sheet in Messages, though. Is this possible?

(I also don’t know if an inbound message can trigger a Shortcuts Personal Automation - but that might not even be what you need.)

Thanks for the reply. An inbound message can trigger a personal automation (and you can filter by sender and whether the message contains certain phrase), but there’s seeminly no way to get the full text. I suppose I can go into message, copy the text and then run a shortcut to get the text from clipboard, whch is better than nothing, but it’d be much better to automate it…

Ouch. And what about the share sheet?

No luck. I don’t think there’s even a share sheet in Message? Can’t even select the text and share…

Oh dear. Sounds a lot like Mail.app. :-(

There used to be an AppleScript handler that could be set by the user in the Messages preferences for running a specified AppleScript script when messages were received. The Script Editor application in Big Bur still has the templates for responding to the Messages handler. You can see by the inclusion of raw event codes that support was pulled by Apple. It was very useful!

using terms from application "Messages"
	on «event ichthe06» this_message given «class hepr»:this_buddy, «class hect»:this_chat
		-- EXAMPLE: this routine automatically accepts a text chat invitation for specified buddies
		set this_name to the name of this_buddy
		if the name of this_buddy is in {"Johnny Appleseed"} then
			set the greeting_name to the first name of this_buddy
			if the greeting_name is "" then set the greeting_name to this_name
			accept this_chat
			send "Hello " & greeting_name & "!" to this_chat
		end if
	end «event ichthe06»
end using terms from