-
Posts
9 -
Joined
-
Last visited
-
Days Won
3
Content Type
Blogs
Gallery
Downloads
Events
Profiles
Forums
Articles
Media Demo
Posts posted by gustebeast
-
-
I wrote up an extremely hacky way to reply to iMessages (should also work with SMS, maybe even group conversations) using the chat.db database. It will display the number of who it thinks is your most recent contact so you don't accidentally send your grandmother a reply intended for your significant other. Ideally it would show the person's name by looking up the number in your contacts, but I don't know how to do that so for now it's just the phone number.
To use, just open Alfred and type ".. <message>"
If it works, you'll see in the sub text the last message from that conversation. Hopefully that provides some useful context. Expect it to not work a fair amount though because the chat.db database is not too reliable.
Any suggestions for ways to improve this are welcome.
https://www.dropbox.com/s/74ggiacfc3zpk0z/Reply%20to%20iMessage.alfredworkflow?dl=1
-
Hmm, I've download it and I don't like as much as yours. I loved that I could message contacts from within alfred rather than opening the imessage app.
Agreed, it's easy enough to open messages and select a contact. Being able to send and reply to messages straight from alfred is much more useful.
-
Unfortunately, the answer to your question is that it's currently impossible to do because the AppleScript support in Messages.app is broken.
Your code should work, but Messages.app isn't giving you the text chat objects it says it does:
tell application "Messages" to return properties of every chat
produces:
{{class:item}, {class:item}, {class:item}, {class:item}, ...}
which is just a bunch of empty records.
Compare it with Safari:
tell application "Safari" to return properties of every window
which returns:
{{document:document "Reply to Message - Workflow Help & Questions - Alfred App Community Forum" of application "Safari", closeable:true, zoomed:true, class:window, index:1, visible:true, name:"Reply to Message - Workflow Help & Questions - Alfred App Community Forum", modal:false, miniaturizable:true, titled:true, id:23277, miniaturized:false, floating:false, resizable:true, bounds:{1263, 761, 2543, 1547}, current tab:tab 4 of window id 23277 of application "Safari", zoomable:true}, ...}
Oh wow. I had no idea that major releases could have such significant issues. Thanks for the heads up and hopefully they'll fix this in a reasonable time scale.
-
Hi there,
Could you please fill in your Powerpack email address in your forum profile first? We'll then be happy to help you out
Cheers,
Vero
I updated my profile. Also, just to be clear, the issue is really around the inability to access properties of objects using apple script. I made a stack exchange thread here: http://apple.stackex...ect-not-working
which has unfortunately received no replies.
If I could figure out how to get the "updated" property from each chat the above script would work perfectly. The only reason the above script even runs is because of the try statement (every iteration errors).
I hope that you can still help though since if this was fixed it would make a really great workflow.
-
I've been using this applescript for a while:
set _message_ to "{query}"
tell application "Messages"
set _chats_ to get every text chat
repeat with _chat_ in _chats_
try
set _check_ to updated of _chat_
set _current_ to updated of _recent_
if _check_ > _current_ then
set _recent_ to _chat_
end if
on error
set _recent_ to _chat_
end try
end repeat
send _message_ to _recent_
end tell
But unfortunately with El Capitan it started sending messages to seemingly random people, certainly not the last one I received a message from. I am looking for a way to modify this script such that it will send _message_ to the last person I either sent a message to or received a message from (as if I opened the app, selected the conversation that appears first and texted them _message_)
Such a script would be incredibly useful, especially when paired with Alfred, allowing one to hold a conversation over text while operating another app in full screen.
Any help is greatly appreciated
-
Well it is also possible that something unrelated happened to cause the issue. No guarantee yet that el capitan is causing the problem. Is there any way I could check?
-
Do you have any idea why it might break? Perhaps it might be something simple I could fix myself.
-
On the el capitan beta the reply to latest message feature always sends messages to one of my group chats (even if I haven't sent anything to it in a long time). Is there any information I could provide to get this issue fixed?
Text/Message on iMessage directly from Alfred
in Share your Workflows
Posted
Been waiting for you to update it for a while, glad to have it back. Unfortunately though the ".." command doesn't function properly for me. Sends a message to someone random. I think this is because the applescript for messages is broken (not sure if they fixed it in the last few months).
I wrote up a workflow to try and implement ".." without using applescript:
But unfortunately it is very unreliable and often will just report that it can't find the most recent contact. Fortunately when it does work it at least never sends it to the wrong person