chrisfsampaio / imsg

Chat using iMessage from your terminal!
MIT License
692 stars 46 forks source link

Ability to message yourself #37

Open skela opened 9 years ago

skela commented 9 years ago

It would be good to be able to message yourself using imsg. That way you could write scripts, that used imsg, to notify you when they are complete etc.

chrisfsampaio commented 9 years ago

That's a cool idea! It's already possible to do that, but I think it would be handy to have an one-line command that would send the message to yourself.

I'll mark that as an enhancement so that I can work on that when I have time. Feel free to issue a pull request if you feel like it! :smile:

skela commented 9 years ago

I had a quick look at it myself, if I try something like:

osascript -e 'tell application "Messages" to send "This is a message" to buddy "Alek Slater"'

I get the following error:

31:78: execution error: Messages got an error: Can't send a message to yourself. (1)
skela commented 9 years ago

I'll keep playing with it to see if I can find a command that works. My knowledge of osascript and ruby are very limited though. Is there a way to ask the Messages app which commands it accepts via osascript?

chrisfsampaio commented 9 years ago

Yes, you can open the application 'AppleScript', then go to 'open dictionary' and then select the Messages application 😊

— Sent from Mailbox

On Sun, Nov 16, 2014 at 3:31 AM, Alek Slater notifications@github.com wrote:

I'll keep playing with it though to see if I can find a command that works. My knowledge of osascript and ruby are very limited though. Is there a way to ask the Messages app which commands it accepts via osascript?

Reply to this email directly or view it on GitHub: https://github.com/chrisfsampaio/imsg/issues/37#issuecomment-63205357

skela commented 9 years ago

Wow, excellent, always wondered how people somehow knew what to tell applications to do.