How to use AppleScript send iMessage?

Does anyone know how to send iMessage by AppleScript? I tried lots of times, but still cant send an message sucessfully. I am using OS X 10.8.3.
Here is my code
tell application "Messages"
          set theBuddy to buddy "mailaddressl" of service "Bonjour"
          send "Hi there" to theBuddy
end tell
When I run this code, all I get
error "“Messages”got an error: Can't get“buddy id \"0B6FAA4A-0A36-4A9B-A481-807B5A946D13:mailaddress\"”. " number -1728 from buddy id "0B6FAA4A-0A36-4A9B-A481-807B5A946D13:mailaddress"
Does anyone know how to solve this problem? Thanks!

Here's what I put together, if it helps: https://github.com/yongjunj/AutoForwardIMessage

Similar Messages

  • How to use AppleScript to set "character fill color" in Pages 5.2?

    For Pages 5.2 on OSX 10.9.3, what is the correct applescript for changing the "character fill" of text in pages. 
    If you highlight text, you do this via your mouse in the inspector by clicking "style," "advanced option (the gear wheel to the right of bold, italics, and underline), "character fill color (clicking on the multi-color circle, not the dropdown menu), and then choosing a color that comes up in the "colors" dialogue box.
    I've looked all over and cannot find how to use applescript to set the character fill color in pages. 
    In some examples (not directly related) I see "character fill" used. 
    In others, I see "colorfill." 
    Basically, I want to use applescript, embedded in a keyboard maestro macro, to change the background color of the text (not the text color itself) to particular colors. 
    Given the changes and updates to Pages this year, and to applescript, what's the easy way to do this?
    Thanks!
    Chuck

    Pages v5.2 still does not include selection-object, or character background color entries in its AppleScript dictionary, as does Pages ’09. Indirectly, using System Events, you can get the text selection in Pages v5.2, but then you can do nothing to change the selection. No assurances as to if or when Apple will mature the AppleScript dictionary support for Pages v5 series.

  • How do I stop sending iMessage from e-mail?, How do I stop sending iMessage from e-mail?

    When i send iMessage, it keeps sending it from my E-mail address. I don't know how to fix it, help...

    Okay...so... I played around with the settings, because no one answered. And I fixed it, I will leave the question here with the anwser:
    You have to go to Messages>iMessage>Send and recieve. Then you have to click on your e-mail and log of. I am sure there is a easier way, but this is the one i used.

  • How do use my iPad iMessage to contact with other country iPhone iMessage?

    My friend is using iMessage all the time with singapore number, but when I imesage her with my iPad in Malaysia, the button Send alway in grey color. If I using my iPad send iMessage to my friend's iPhone with malaysia number, it is able to send. Any solution for that?

    I can add people into my contact list, if I want to send an iMessage, I couldnt save her/his name and contact number into Contact list first. After iMessage sent successfully then can only save his/her into my contact list. This is the way I done yesterday.

  • How to use Applescript to print out a certain calendar at 7am every morning?

    Hey guys,
    I am trying to use AppleScript to print out one of my calendars each day at 7am every morning.
    I have come up with this so far:
    tell application "Calendar"
           view calendar "My Appointments" at (my (current date))
           switch view to day view
           activate
                        tell application "System Events"
                     keystroke "p" using command down
                     delay 1 -- (seconds)
                     tell process "Calendar"
                                                      tell window "Print"
                                                                     if value of checkbox "Calendar Keys" is not 0 then
                                      click checkbox "Calendar Keys"
                               end if
                                                      end tell
                                       end tell
                        end tell
    end tell
    The problem with this is that it will print out whatever calendars are currently viewable. I can't figure out how to tell it to deselect other calendars and just select the one I want. I also want to tell it to print this out at 7am every morning.
    Any help would be very appreciated!

    If you wanted to do the printout over multiple days, you would be best to loop through each day's events in the way the current script does, but to put a new loop around it that gets each new day's data:
    --opens a temporary file
    set fileRef to open for access ((path to desktop) as string) & "meetings.txt" with write permission
    --effectively empties the file
    set eof fileRef to 0
    tell application "Calendar"
              set dayCount to 9 --this will be the number of days to look forward (not including today)
              repeat with currentDay from 0 to dayCount
                        set startList to {}
      --get's today's date
      --set startRange to ((current date) + 12 * days) -- I used this for testing, to point to a day that had many appointments.  I've left it so you can use it, too.
                        set startRange to ((current date) + (currentDay * days))
      --set the start of the range to previous midnight
                        set hours of startRange to 0
                        set minutes of startRange to 0
                        set seconds of startRange to 0
      --set end of the range to next midnight
                        set endRange to (startRange + 1 * days)
      --get today's events
                        set todaysEvents to get (events of calendar "My Appointments" whose (start date is greater than startRange) and (end date is less than endRange))
      --make a new list with start time of the event for sort purposes
                        repeat with theEvent in todaysEvents
                                  set end of startList to {startdate:start date of theEvent, eventID:theEvent}
                        end repeat
      --sort using a bubble sort (suitable for short lists)
                        repeat with i from 1 to (count of startList) - 1
                                  repeat with j from i + 1 to count of startList
                                            if startdate of item j of startList < startdate of item i of startList then
                                                      set temp to item i of startList
                                                      set item i of startList to item j of startList
                                                      set item j of startList to temp
                                            end if
                                  end repeat
                        end repeat
      --empty the original list
                        set todaysEvents to {}
      --repopulate the list in correct chronological order
                        repeat with theEvent in startList
                                  set end of todaysEvents to eventID of theEvent
                        end repeat
      --write today's date to the file
      write (date string of startRange & return & return) to fileRef
      --if there are no events, write this to the file as well
                        if length of todaysEvents is 0 then
                                  write "No events" & return & return to fileRef
                        else
      --process each event into format: hh:mm-hh:mm/new line/event summary
                                  repeat with theEvent in todaysEvents
                                            set startdate to start date of theEvent
                                            set enddate to end date of theEvent
                                            set startHours to hours of startdate as string
                                            if length of startHours is 1 then set startHours to "0" & startHours
                                            set startMins to minutes of startdate as string
                                            if length of startMins is 1 then set startMins to "0" & startMins
                                            set starttime to startHours & ":" & startMins
                                            set endHours to hours of enddate as string
                                            if length of endHours is 1 then set endHours to "0" & endHours
                                            set endMins to minutes of enddate as string
                                            if length of endMins is 1 then set endMins to "0" & endMins
                                            set endTime to endHours & ":" & endMins
      --write the event to the file
                                            set theSummary to (starttime & "-" & endTime & return & summary of theEvent & return & return) as string
      write theSummary to fileRef
                                  end repeat
                        end if
      write return to fileRef
              end repeat
    end tell
    --close the file
    close access fileRef
    --print the file
    set theFile to (((path to desktop) as text) & "meetings.txt") as alias
    tell application "TextEdit"
              print theFile without print dialog
    end tell

  • How to use applescript to enter a contact in Microsoft Word

    I am new to applescript, but I am trying to find a good way to use applescript in Microsoft Word along with Dragon Dictate for Mac to automate writing a letter. Dictate allows me to use applescript upon saying a command. What I would like to do is to be able to say "write a letter to ..." and it open my letter template and enter the persons contact info from the address book. There is a contacts menu item in Word that you can double click on the contact and it will paste it into the document, but it would be nice to be able to have it do it automatically without having to keep clicking.
    Any help is appreciated.
    Thanks!
    Ethan

    It's a sheet, not a "modal". This script should tell you if it's up or not:
    tell application "System Events"
      tell process "Safari"
      tell window 1
      if exists sheet 1 then
           display dialog "Sheet is Up"
      else
                display dialog "No sheet"
    end if
    end tell
    end tell
    end tell

  • How to use applescript to open speech calibration window

    I am having a problem with applescript.  I am trying to open the speech calibration window in System Prefrences using applescript.  I am really bad at GUI Scripting.  I don't know if there is some other way to open the window, but I would like to have it appear when the user clicks a button.  I am using Xcode ApplescriptObjC, but I don't think that matters.  Could someone show me a script that opens the accessibility (or universal access) pane, click speakable items, then the "calibrate" button.

    Another way to do this in Captivate 3, to open new window
    using javascript with multiple files:
    Create button and choose Execute Javascript:
    Click the "..." button and type command using the following
    format:
    JavaScript:mynameLaunch();
    ["myname" is the name of the javascript function in relation
    to the file you want to open]
    Publish the Cp file.
    Copy the file to be opened over to the root of the htm file
    folder (for this example "myname.pdf").
    Place the below javascript in the head of the main htm file
    after publishing.
    <head>
    <script src="standard.js"
    type="text/javascript"></script>
    <script type="text/javascript">
    function mynameLaunch(){window.open("myname.pdf",
    "","toolbar=no,location=1,top=50,left=50,status=no,menubar=no,scrollbars=yes,resizable=ye s,width=400,height=575");
    </script>
    </head>
    Test on a web server.

  • How can I only send imessages and not texts on my iphone 4S

    I have turned OFF Send as SMS on the settings of my iphone. However the phone still allows me to send text messages using the message facility. I am aware that green equals text and blue equals imessage.
    I would however like to disable or at least have a reminder before sending a text in order that I do not get billed for sending photos attached to text instead of as imessages
    I thought that turning OFF Send as SMS in the settings field would prevent me sending texts and only allow imessages to go out, but this does not seem to be the case
    Regards
    Dave

    You can turn off sending pictures messages except as iMessages by going to Settings>Messages>MMS Messaging and setting it to "Off".

  • How to use AppleScript to clean up desktop?

    I am writing a script that will take all the image documents on my desktop and place them into a newly created folder on the desktop called "desktop images". It'll take all the .dmgs and put them in another folder, etc. Then the remaining icons should arrange themselves by name. Disks should be ejected and caches dumped. Then the trash should be emptied. After all this, a dialog displays "Mission Accomplished. Would you like to Shut down, Restart, or Continue."
    I have nearly everything I need put together except for the blasted desktop clean up. Here's how I have it right now:
    tell application "Finder"
    clean up window of desktop by name
    end tell
    {Finder got an error: Can't get window of desktop.}
    tell application "Finder"
    activate
    clean up window 1 by name
    end tell
    --this one works on opened windows, but not on the desktop.
    I have also tried other various methods to no avail. Help me please.

    Thanks for the input Tony D and ByTheLightOfQuiveringAspens.
    'm curious, why not do it in Automator?
    I guess the biggest reason is because I'm learning AppleScript. I want to know how to do everything in AppleScript. Then, I also plan on making an AppleScript App using X Code stuff that implements all of my cool scripts I put together.
    Some of the ones I have so far are a finder refresher, a show hidden files, an app unfreeze, bring all windows to left of monitor 1, and a really huge one that uses gui scripting to help people set up their ip printers at my college.
    Now to the point at hand
    2.) Do you know that Scipt Editor in reference to the Finder is recordable, and that you could set all of the icons...
    I tried to use the record button but with no luck. Under OS 10.5, it just records every movement of the icons as "select window of desktop". And when I move the icons, it doesn't add to the script at all.
    1.) How, specifically, do you want to "clean up" the desktop?
    I tried selecting "Arrange By>Name" but it still doesn't record the action. The AS dictionary for the Finder says that it's possible; however, I can only get it to work in opened windows on the desktop using this script:
    tell application "Finder"
        activate
        clean up window 1 by name
    end tell
    If there is no wat to do it with a traditional AS, if a shell script existed that could do it, I'd be happy to know it.

  • How to use applescript to calculate a value

    I have an applescript like this named myTestFile and I have placed it in the applescript folder of AppleWorks
    on test
    return 5
    end test
    then in the appleworks spread sheet I put this in one of the cells:
    =MACRO("myTestFile", 2, "test")
    however when I try to evaluate the cell it give me the error, "An unexpected error occurred. #23316." I have been trying to get around this error for two days now and I am about to pull my hair out. Please help me! I am using version 6.2.9 of appleworks.
    Thank you in advance for any help.
    iMac   Mac OS X (10.4.3)  

    Have you read Yvan's User Tip explaining how to do this?
    <http://discussions.apple.com/thread.jspa?messageID=607577&#607577>
    See Point B on the above page.

  • How to use AppleScript, Safari, JavaScript, and jQuery together

    Hello to all,
    I am running AppleScript to populate some forms on various websites, but to activate some behaviors on the various forms that I can't activate with Safari and JavaScript I think I might need jQuery. Only problem is that I don't really know how to get the functions of jQuery embedded into a running AppleScript.
    Would any of you knowledgeable people know how to accomplish this.
    Any help would be welcome.
    Thank you,
    Chris

    Yes I did get to that part.... I went trough external to retrive itunes folder... When I selected the folder, it said that it was locked, choose another folder... I then went to my external again to my itunes folder and and used command I to see if folder was locked and it wasn't.... it was suggested on another forum to reboot.. which I did and still same problem... All I want to do is link my external hard drive that has my itunes playlist from another Mac to my new one.. and to also use the external as the main source for adding new songs to my playlist...

  • How to use applescript photoshop batch

    Hello, good afternoon.
         I'm trying to make an applescript that will run a batch procedure in photoshop and I don't know how to wirte its code. Let me show my script :
    set pasta_evento to choose folder with prompt "Select folder of the event: "
    set pasta_tratadas to (pasta_evento as string) & "Tratadas:" as alias
    set arq_log to (pasta_evento as string) & "Log_Erros.txt"
    tell application "Finder"
              if not (exists file arq_log) then
      make new file at pasta_evento with properties {name:"Log_Erros.txt"}
              end if
    end tell
    set Fotos to files of pasta_evento as alias list
    tell application "Adobe Photoshop CS6"
      activate
                                  set display dialogs to never
                                  batch "13 x 19 + sharpen" from files Fotos  from "My Actions" with options {destination:folder, destination folder:pasta_tratadas, error file:alias arq_log}
    end tell
    I think I have two problems. I realized that if I change the instruction as below, it works. So, there's something wrong with the variable Fotos and with the batch options (I tried to read the photoshop applescript ref, but I don't know what's wrong.
    tell application "Adobe Photoshop CS6"
      activate
                                  set display dialogs to never 
                                  batch "13 x 19 + sharpen" from files {"Disk:Users:Me:Pictures:Macros:Tratadas:0002.JPG", "Disk:Users:Me:Pictures:Macros:Tratadas:0025.JPG"} from "My Actions"
    Could anybody help me correct this code ? I'm not definetively an expert!
    Tks !

    Hi Muppet, tks for the help !
         I tried to feed it strings by many ways friend, but I as I told you I'm not an expert and couldn't make it work... So sad ...
         When I run :
    batch "13 x 19 + sharpen" from files Fotos  from "My Actions"
    In  the results it comes :
    batch "13 x 19 + sharpen" from files {alias "Disk:Users:Me:Pictures:Macros:Tratadas:0002.JPG", alias "Disk:Users:Me:Pictures:Macros:Tratadas:0025.JPG"} from "My Actions"
    And it doesn't work, Photoshop opens a dialog informing : There were no source files that could be opened by Photoshop.
    When I write the alias list manually it starts the batch command.
    batch "13 x 19 + sharpen" from files {"Disk:Users:Me:Pictures:Macros:Tratadas:0002.JPG", "Disk:Users:Me:Pictures:Macros:Tratadas:0025.JPG"} from "My Actions"
    In the Applescript Photoshop Ref:
    batch v : run the batch automation routine
    batch text : the name of the action to play (note that the case of letters in the Action name is important and must match the case of the name in the Actions palette)
    from files list of alias : list of input files to operate on
    from text : the name of the action set containing the action being played (note that the case of letters in the Action Set name is important and must match the case of the name in the Actions palette)
    [with options batch options] : options for Batch
    AND
    batch options n : options for the Batch command
    properties
    destination (folder/none/save and close) : final destination of processed files ( default: none )
    destination folder (alias) : folder location when using destination to a folder
    error file (alias) : file to log errors encountered, leave this blank to stop for errors
    file naming (list of ddmm/ddmmyy/document name 3/document name lower/document name mixed/extension lower/extension upper/mmdd/mmddyy/serial letter lower/serial letter upper/serial number four/serial number one/serial number three/serial number two/yyddmm/yymmdd/yyyymmdd) : list of file naming options 6 max.
    macintosh compatible (boolean) : make final file name Macintosh compatible ( default: true )
    override open (boolean) : override action open commands ( default: false )
    override save (boolean) : override save as action steps with destination specified here ( default: false )
    startingserial (integer) : starting serial number to use ( default: 1 )
    suppress open (boolean) : suppress file open options dialogs ( default: false )
    suppressprofile (boolean) : suppress color profile warnings ( default: false )
    unix compatible (boolean) : make final file name Unix compatible ( default: true )
    windows compatible (boolean) : make final file name Windows compatible ( default: true )
    When I try to use the batch options Photoshop it says the batch command is invalid or not supported.
    With these informations do you could help me ?
    I'm loosing my hopes ...
    Tks !

  • How to use SOAP sender adapter

    Hi all
    i have configured the SOAP sender adapter. Now my 3rd party needs to send me a soap message. 
    I have checked that the status at the following URL is OK:
    http://host:port/XISOAPAdapter/MessageServlet?channel=:MXII_Web_Service:SOAP_MXII_Sender.
    This is fine, however
    I am unsure of the following:
    1. Does XI make a wsdl available to the 3rd party?
    2. Where does my 3rd party send the soap message to?
    3. Is the SOAP message sent via a query string?
    4. Do I need to create a web service?
    Thanks for all your help in advance
    Clinton

    Hi Moorthy
    Thanks for your answer.
    The problem was solved, we used .Net to write a webservice to our wsdl.
    I have now another problem.... When the message comes into XI it shows that no receiver found(RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC). If I just test the scenario with a file adpter as Sender, and Receiver it is fine, but when using the SOAP adapter as Sender, it gives me the no receiver found message.
    Any help with this issue will be appreciated.
    Thanks again
    Clinton

  • Valid email certificate in Keychain - How to use it sending messages?

    After asking a free Personal E-mail Certificate by thawte.com, I was enabled to dowload a file which automagically added my personal certificate in my Keychain. Wow.. nice.. and now?
    How to add this certificate in the headers of my messages?
    Btw, during the thawte subscription, the form asked for my browser and mail program.
    In the options, nothing about Apple. I wrote them giving my preferences: Safari and Mail.
    They replied me:
    -- begin --
    When requesting the certificate, please use the option:
    Mozilla Firefox/Thunderbird, Netscape Communicator/Messenger
    and it will work with your Apple set up.
    -- end --
    Any idea on how to proceed?

    Solved
    I just had to restart Mail, and the sign was there :-))
    Hope this helps someone.

  • How to use applescript to click a button in a modal window

    When I try to close a Safari page, sometimes a popup (a modal window?) shows up asking if I want to "Stay on Page" or "Leave Page". I'm trying to write an applescript to look for such a window and click "Leave Page". I have trouble referencing the popup. Is it treated as a window in Safari? I asked for a count of number of windows and applescript doesn't seem to include this modal window in the count. I tried something like:
    tell application "Safari"
        set theWindows to every window
            repeat with theCurrentWindow in theWindows
                  if(modal of theCurrentWindow) then
                    -- appropriate action
                  end if
            end repeat
        end tell
    end repeat
    it looks like   "modal of theCurrentWindow" always returns false. So I'm guessing "theWindows" doesn't include the popup. How do I reference the popup so that I can perform some action on it?

    It's a sheet, not a "modal". This script should tell you if it's up or not:
    tell application "System Events"
      tell process "Safari"
      tell window 1
      if exists sheet 1 then
           display dialog "Sheet is Up"
      else
                display dialog "No sheet"
    end if
    end tell
    end tell
    end tell

Maybe you are looking for

  • How to create application log in SAP

    According to my reqirement,I need to display messages in the application log whenever some updation is done. How to do create application log and display messages in the application log.

  • Add Custom Field in Additional Tab B in VA01/VA02

    Kindly help me out , I have a requirement to add a custom field at Header level in Additional Data B tab of VA01/VA02. Program: SAPMV45A screen 8459 This can be done only through access key or not. Can any body tell me procedure to do that. Appreciat

  • Color Removal in Photoshop

    OK, so I'm wondering why there isnt the specific function to select a color or color range, and then use a slider to fade out a given color from the image yes, I'm aware of Select > Color Replacement, but to be honest it does a superficially good job

  • Mfp127fn

    hi,  There is a problem with installing the MFP127fn driver and software. Tried to instal over network with original CD   - fatal error. Tried to install over usb - the same - fatal error. Tried to install only the driver thru device manager - PCLmS

  • Solution Manager IT Performance Reporting..

    We are using IT Performance reporting in the Solution MGR system and now I have a end user who would like to have access to these reports. We tried to give him CCMSBISUITE but he is still not able to see the report, he is getting tons of Authorizatio