Send image from Messages.app to iMessage - MacRumors Forums
Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 20, 2012, 01:53 AM   #1
MACza
macrumors member
 
Join Date: May 2011
Send image from Messages.app to iMessage

Hi Guys!

I hope somebody can assist me with an applescript I am attempting.

The aim: to send myself an image from my MAC to my iphone via Messages/iMessage.

OK, I can send text messages successfully with the following:

Code:
tell application "Messages"
	set myid to get id of first service
	set theBuddy to buddy "+123456789" of service id myid
	send "Test message" to theBuddy
end tell
How do I now add an image to the message?

I was trying something like the following:

Code:
tell application "Messages"
	set myid to get id of first service
	set theBuddy to buddy "+123456789" of service id myid
	set targetFileName to "Macintosh HD:Users:user:Pictures:picture.PNG:"
	make new attachment with properties {file:targetFileName}
	send "Test message" to theBuddy
end tell
WIth the above, I get the following error back:
"Messages got an error: Can’t make or move that element into that container."

I am not sure what this means or what the solution is

It also seems like I should tell Messages to send the attachment. Not sure if it should be part of the "send" command, or if I should send the image in it's own "send" call.

Any help will be greatly appreciated!

Thanks!
MACza is offline   0 Reply With Quote
Old Oct 21, 2012, 11:23 AM   #2
MACza
Thread Starter
macrumors member
 
Join Date: May 2011
Ah, never mind, I finally got it sorted out! :-)
MACza is offline   0 Reply With Quote
Old Nov 8, 2012, 09:10 AM   #3
keithjmason
macrumors newbie
 
Join Date: Nov 2012
Hi,

Would you mind sharing how you sorted this out ? Trying to do the same thing.

Thanks!

Keith
keithjmason is offline   0 Reply With Quote
Old Jan 20, 2013, 03:20 PM   #4
gentertain
macrumors newbie
 
Join Date: Jan 2013
Hi,
how did you fix the error? i am interested in doing the same thing.

Thanks
gentertain is offline   0 Reply With Quote
Old Jan 30, 2013, 12:14 PM   #5
dhval
macrumors newbie
 
Join Date: Jan 2013
set theAttachment1 to POSIX file /Users/lil/pic.png
tell application "Messages"
send theAttachment1 to buddy "+1 (xxx) x7 " of service "E:yourappleid@gmail.com"
end tell
dhval is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iMessage Refuses to Send Messages Ryan Burgess iMac 5 Jul 28, 2013 02:20 PM
iMessage won't send messages on iPad via bluetooth tether OberTiger iOS 6 12 Jul 26, 2013 12:13 PM
iMessage Not Appearing in Messages App boba7523 OS X 10.8 Mountain Lion 7 Mar 25, 2013 07:45 PM
Project Amy Allows Users to Send App.net Private Messages via Messages for OS X MacRumors Mac Blog Discussion 6 Mar 5, 2013 10:31 AM
Mountain Lion Messages app wont let me send text messages EstrlM3 Mac Applications and Mac App Store 7 Jul 28, 2012 12:11 PM

Forum Jump

All times are GMT -5. The time now is 09:09 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC