Need applescript for Messages to send Passbook .pkpass attachments

Hi - I'm trying to write an applescript to send iMessages to a list of recipient Phone numbers with Passbook .pkpass files as attachments.
Here's my simple sendMessage.applescript file
on run {targetBuddyPhone, targetMessage, targetFile}
          tell application "Messages"
                    set targetService to 1st service whose service type = iMessage
                    set targetBuddy to buddy targetBuddyPhone of targetService
  send targetMessage to targetBuddy
  send file targetFile to targetBuddy
          end tell
end run
I'm calling this from Terminal with command:
osascript sendMessage.applescript <Phonenumber> "Here's your Passbook coupon" Coupon.pkpass
When I execute the command, my targetMessage is correctly sent. However, the .pkpass file transfer says it is waiting for the recipient to accept the file transfer.
When I send it to my own iPhone, I don't receive any request to accept a file transfer.
How can I modify this script such that the file is properly attached to the iMessage and it sends with an auto-accept condition ?
Thanks if you can help,
Andrew

Right click Job Definitions on the left navigation tab and create New Job definition. When prompted, select Mail type and click Create.
Now provide the HTML coding for your mail format inside the job definition and for dynamic values like Job definition, you can pass them from another job definition.
You can attach the files by mentioning the filename under the [Attachments] .
For this you must explicitly provide permissions to the directory where the files are stored in the server.
I recommend following the admin guide, which has clear examples.
thanks
Nanda

Similar Messages

  • I need help for actionscript 3, sending php info to my email, website created in Flash cs5 pro

    Hi,  My name is David and I followed a course creating my own website from Lynda.com by Paul Trani. After that I created my first own webste. After I finished it, everything was working well in flash and firefox. I have only one problem and question concerning the feed back form for sending info from my website to my emailaddres. I created my website “LisbonDreamWalking”in Flash CS5 pro. I herein have a contact page, where people can send an email for a walk in Lisbon, date,the number of people etc. Now I want through my ISP / host funpic.org, that the input, info text fields to be sended to my emailaddress [email protected]. My mail URL adress  iss: http://lisbondreamwalk.li.funpic.org  This is a free host, so they don't work with forms like in the course, and I need some additional info for the php. Here is my HTML (Flash actionscript 3.0) for the sending I only have the red text to fill in (php), I was told by the adobe course.I really hope someone can help me?! Thanks in advance!
    Instructions: 1. Add your custom code on a new line after the line that says "// Start your custom code" below. The code will execute when the symbol instance is clicked. */  send_btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_13);  function fl_MouseClickHandler_13(event:MouseEvent):void {          if (thename.text == "" || theemail.text == "" || thetime.text == "" || thepersons.text == "" || themessage.text == "")      {           thankyou.text = "please fill out all fields";      }      else      {           // create a variable container           var allVars : URLVariables = new URLVariables();           allVars.name = thename.text;           allVars.email = theemail.text;           allVars.time = thetime.text;           allVars.persons = thepersons.text;           allVars.message = themessage.text;           //Send info to a URL           var mailAddress:URLRequest = new URLRequest("http.www.namewebsite.com/gdform.php");           mailAddress.data = allVars;           mailAddress.method = URLRequestMethod.POST;           sendToURL(mailAddress);            thankyou.text = "Thank YOU!";           thename.text = "";           theemail.text = "";           thetime.text = "";           thepersons.text = "";           themessage.text = "";      } }
    H

    Thank you Kglad, I am going to see if I can make it work. I will let you know!
    Date: Thu, 13 Oct 2011 08:55:05 -0600
    From: [email protected]
    To: [email protected]
    Subject: I need help for actionscript 3, sending php info to my email, website created in Flash cs5 pro
        Re: I need help for actionscript 3, sending php info to my email, website created in Flash cs5 pro
        created by kglad in Action Script 3 - View the full discussion
    you missed part of the tutorial (or the tutorial is incomplete):  send_btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_13); function fl_MouseClickHandler_13(event:MouseEvent):void{     if (thename.text == "" || theemail.text == "" || thetime.text == "" || thepersons.text == "" || themessage.text == "") { thankyou.text = "please fill out all fields"; } else { // create a variable container var allVars : URLVariables = new URLVariables(); allVars.name = thename.text; allVars.email = theemail.text; allVars.time = thetime.text; allVars.persons = thepersons.text; allVars.message = themessage.text; //Send info to a URLvar mailAddress:URLRequest = new URLRequest("http.www.namewebsite.com/gdform.php"); mailAddress.data = allVars; mailAddress.method = URLRequestMethod.POST; sendToURL(mailAddress);
    }}  var urlLoader:URLLoader=new URLLoader(); function sendToURL(mailAddress):void{urlLoader.addEventListener(Event.COMPLETE,completeF);urlLoade r.load(mailAddress);} function completeF(e:Event):void{ thankyou.text = "Thank YOU!"; thename.text = ""; theemail.text = ""; thetime.text = ""; thepersons.text = ""; themessage.text = "";}
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/3969414#3969414
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/3969414#3969414. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Action Script 3 by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Applescript for Messages status

    Hello,
    I try change status for Message app
    I use that script to set offline status:
    tell application "Messages"
         set status to offline
    end tell
    and that work correct
    but when I try to set status to available or any else:
    tell application "Messages"
         set status to available
    end tell
    then I haven't any results
    what wrong?

    Brian Smith5 wrote:
    where whatever is the name of the service you're sending messages over. Not every messaging service has a status option, so I'm not sure that setting a global status has any meaning.
    Where can one find the name of the service?
    To get the names of the services, I used the following:
    tell application "Messages"
              get every service
    end tell
    That returned three services:  "Default" and two strings of characters.
    I then tried your script:
    tell application "Messages"
              set status of service "whatever" to available
    end tell
    I replaced "whatever" with each of the three services returned by the first script.
    All three returned this error:
         Messages got an error: Can’t set service "[name of the relevant service]" to available.

  • Mail how do i set a read receipt for messages I send

    mail how do i set a read receipt for messages I send

    Hi Sunny
    There's no built-in option, and the workaround is rather complex. I would advise against it, since "read receipts" are not a standard part of the email protocol, and most email clients cannot return receipts or have it turned off anyway.
    Matt

  • Error message when sending photos as attachments in mail

    When sending photos from i photo in mail I get an error message "Can't get paragraph 8 of content of outgoing message id 142504208. Invalid Index" I can send one photo at a time but no more than one. I have recently upgraded to leopard from panther. I tried rebooting but no success. Any suggestions greatly appreciated.

    Bump. I have the same problem. Anyone shed some light on this?

  • Send Windows Friendly Attachments option in Mail 1.0

    I'm troubleshooting for my brother and need to know if the "Send Windows Friendly Attachments" option is available in Mail 1.0. He couldn't find the option.

    Attachments<Send Friendly Window
    If the following is not done, the PC recipients will see multiple attachments. (Mail will send the file’s data fork and its resource fork) .......
    Method 1....
    • Menu>Edit>Attachments>Always Send Windows Friendly Attachments
    • Open Mail ....Command-N or click the “New” icon in the Toolbar
    • Type what is required and then..
    • Click the “Attach” icon in the Toolbar
    • Navigate to the file
    • Select “Choose File”
    • Click “Send” icon in the Toolbar or (command-Shift-D)
    Method 2 ...
    • Open Mail ....Command-N or click the “New” icon in the Toolbar
    • Type what is required and then..
    • Click the “Attach” icon in the Toolbar
    • Navigate to the file and check the box “Send Windows Friendly
    Attachments”
    • Select “Choose File”
    • Click “Send” icon in the Toolbar or (command-Shift-D)
    Method 3 ....
    • Make a folder on your Desktop and add files to it (pictures, etc).
    • Control-click on the folder and choose “Create Archive of 'Your Folder'.”
    • This makes a compressed archive of the folder in ZIP format.
    • Drag the resulting archive (it ends with '.zip') into your mail message.
    george
    iMac Flat Panel 1.25GHz 80GB 256MB   Mac OS X (10.3.9)  

  • I cant send MMS using my iphone 5s . it keep on prompt me a msg "MMS Messaging needs to be enabled to send this message", but inside "setting/message" there's no button for me to ON the SMS/MMS. pls help. Thks

    I cant send MMS using my iphone 5s . it keep on prompt me a msg "MMS Messaging needs to be enabled to send this message", but inside "setting/message" there's no button for me to ON the SMS/MMS. pls help. Thks

    @Dmitriy Buldakov, have you found the solution to the issue yet? I have the same problem, no option to turn on MMS in my iPhone settings. I checked the settings on my friend's iPhone, which has the same iOS version as me (8.1.1), and the option is there. It's really annoying...

  • TS2755 Hi all, I bought one iphone and 3 ipads, i set up all on one apple ID. Now i have a problem when using messages: when sending message from one device it appears again on screen from the other 3 devices. I need help of how to set up messages on each

    Hi all, I bought one iphone and 3 ipads, i set up all on one apple ID. Now i have a problem when using messages: when sending message from one device it appears again on screen from the other 3 devices. I need help on how to set up messages on each device separately and to start using messages app on each device independently. Thanks

    search google for "iphone remove picture from contact"

  • Help Needed: Automator Applescript for Folder Action - Encode Video

    Hi !
    I have created an Automator Applescript for a Folder Action to do the following:
    When a new video file is moved to the target folder (i.e. Download of Vuze is done), automatically launch the Applescript Action that does the followin g(Applescripted):
    1) Using "run shell script" and FFMPEG on a UNIX command line, determine Width/Height, Framerate, Bitrate
    2) Calculate encoding parameters (slightly reduced bitrate, reduced Aspect etc.)
    3) Using "run shell script" with ffmpeg on the command line and the calculated parameters to encode the video file
    At the same time, the action is written to a log file so I know if a file is recognized, when encoding started etc.
    It works fine if I save this Action as an .app, make an alias on the Desktop and drop video files on it.
    It also works fine if I attach the script to a folder as a folder action and drag a video file in there.
    However, when I attach the script as a folder action to the Vuze download folder, it encodes only some video files, i.e. if there was a download of 5 files, chances are good that it will not encode 1 or 2 files out of those 5.
    If for example a second download finishes while the encoding for the first download is still going on, sometimes the second file starts encoding after the first encode finishes, sometimes it does not, the file does not make the log file at all, i.e. the folder action missed it or the automator action dropped it because it was still encoding. Still, sometimes it happens, sometimes not.
    As I need a solution that is 100% accurate, I would like to ask if there are any ideas on how to do this better maybe? As I am not an Applescript Guru, I would need some help to know what works and what doesn't and what the syntax is.
    My main idea right now:
    Similar to how ffmpegX works with its "process" application, have a second script (as .app) that receives the files to be encoded from the automator action and puts them in a queue, then proceeds to encode this queue while the main automator action is free to receive the next file.
    Writing this second app is quite straightforward (a modified version of my current script) but I have some questions I need help with:
    1) How do I call another applescript from within an existing applescript that launches the new applescript in a new process?
    2) How do I pass parameters to this new applescript?
    3) In case of this "Queueing" Idea, once I called the external applescript the first time, how do I make sure when I call next time, that I don't open a second instance of this script but rather pass another queue item to the original instance to be processed?
    Or in general: Is there a better way to achieve this automatic encoding solution that I have not thought about?
    Alternatively:
    Does anyone know how to call the "process" application that comes with the ffmpegX package with the correct parameters to use as a queueing / processing tool?
    Thanks!
    Joe
    Message was edited by: Joe15000
    Message was edited by: Joe15000

    To do this, I created an Automator workflow with an Applescript snippet to change the 'media kind'.
    Here is the 'Run Applescript' workflow step code:
    on run {input, parameters}
              tell application "iTunes"
                        set video kind of (item 1 of input) to movie
              end tell
              return input
    end run
    Prior to this running, I have an 'Import Files into iTunes' workflow step.
    You can switch out 'movie' with: 'TV show', 'music video', or anything in ITLibMediaItemMediaKind.
    Good luck,
    Glenn

  • "iMessage needs to be enabled to send this message?

    What does "iMessage needs to be enabled to send this message" mean?  I can't get my messages to send and when I try that pops up. What is it and how can I fix it?

    I have a similar problem as the OP, I wished to disable iMessage just to avoid the complications of having two messaging systems. Also, I never use data and always keep it off in order to save battery. Third, I noticed that when using iMessage, sometimes others' messages to me reach me late, i.e. they would send it at 3 pm and I would receive it at 6 pm when I turned on my wi-fi (remember, I have data off always). For these reasons I chose to completely disable imessage.
    However, for one of my contacts, I noticed that the "send" button was still blue, rather than green (as you know, green is for ordinary SMS while blue is for iMessage). When I try to send this person a text, I naturally get the "imessage needs to be enabled to send this message". I tried the solutions in this thread, but none of them worked.
    However, I managed to find a workaround. First, I turned on iMessage, then I turned on "send as SMS if imessage not available" in the settings. Then, I disconnected my wifi and data so that imessage would not be available, then I tried to send an iMessage to the person in question (the one with the button stuck on blue). This time I did NOT get the error message, but the iMessage tried to send anyways, getting stuck when the bar was around 85% complete. Then, I pressed on the speech bubble being sent, and manually chose "send as text message"). Voila! the button suddenly turned green, and now I can send regular texts to that person again!

  • Export mail message as PDF Applescript for mail rules

    I have looked everywhere for this and found nothing. I don't have 40 hours to learn applescript myself but from the little I do know this should be possible. Probably easy.
    I want to created an applescript to run as a mail rule. I want the script to export the message as a PDF and move that PDF to a specified folder. Hazel can take it from there.
    for instance:
    Fedex sends me a email message that my shipment has been delivered.
    mail rule kicks in and runs the script
    script creates a PDF of the message
    message is moved to "fedex delivered" folder

    I found a workaround, though there must be something neater.
    I added this before my script
    tell application "System Events"
              tell process "Mail"
                        tell menu bar 1
                                  tell menu bar item "View"
                                            tell menu "View"
                                                      tell menu item "Sort By"
                                                                tell menu "Sort By"
                                                                          click menu item "Subject"
                                                                end tell
                                                      end tell
                                            end tell
                                  end tell
                        end tell
              end tell
    end tell
    then the same except "Date" instead of "Subject".
    My script does what i want now.

  • HT204161 I want to use iCloud for every thing else except for Messages. I do not want to send an iMessage and receive it on both my iPhone and Mac.

    I want to use iCloud for every thing else except for Messages. I do not want to send an iMessage and receive it on both my iPhone and Mac.
    How do I do that?

    Howdy kingtonz,
    If I understand you correctly, you want to limit to limit your use of the Messages application to non-iCloud sources such as text messaging through your phone carrier, is that right?
    You can turn off the use of iMessages in Settings > Messages > iMessage. See this help article -
    Messages settings - iPhone
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • I just purchased Time Capsule today.  I ONLY want to use it as an external drive.  I do not need it for Time Machine. I can see the TC in my finder, but when I click on a file or video to drag and drop, I get message that TC can't be modified. Help please

    I just purchased Time Capsule today.  I ONLY want to use it as an external drive.  I do not need it for Time Machine. I need to free up room on my computer. As of now, I can't even load updates. I can see the TC in my finder, but when I click on a file or video to drag and drop, I get message that TC can't be modified. Help please!

    I agree with Kappy.. passing files and especially via wireless is slow as slow.
    Just need to be sure your TC is the new AC model??
    And the OS on the computer is Lion?
    Have you completed the setup of the TC via the utility? You do still need to get internet via the TC so it has to be plugged into the main router..
    Give us the full picture of the network.
    Then we can help you get into it.. whether you should put your files on it is another question.

  • On iPhoto, I can no longer access the 'Classic' option which would lay out my photos on the page. It will send them as attachments only. I need the page layout for my work. Any thoughts as to why this has changed?

    On iPhoto, I can no longer access the 'Classic' option which would lay out my photos on the page. It will send them as attachments only. I need the page layout for my work. Any thoughts as to why this has changed? It used to fully lay out the photos so I could add notes and detailed information before I sent them. I am thinking it is something simple that I have just missed...

    The "Photos" view has been replaced by the Media Browser.
    Most applications will show you the Photos icon in the Sidebar, when you need to select photos in a file chooser dialoge. Mail, Safari, the iWork apps. See Terence Devlin's User Tip: How to Access Files in iPhoto
    For example, in the File > Open dialogue in Preview I am seeing this in the sidebar.

  • On my itouch 4th gen, I use imessage and message many people, but sometimes when i send a message the send bar on top will go almost all the way and stop. This will happen for some time and then work later. is there anything to avoid the freezinginsending

    On my itouch 4th gen, I use imessage and message many people, but sometimes when i send a message the send bar on top will go almost all the way and stop. This will happen for some time and then work later. is there anything to avoid the freezing problem while it sends

    See:
    iOS: Troubleshooting Messages
    However, I suspect it is just a tempery network problem beyond your control

Maybe you are looking for

  • Network issues. Packet loss when spray is used!!!!!!!!!!!!!!!

    Hi, I am not in a position to figure out, is it an issue with my server or my network. I run spray and find packet loss...what should I suspect? In one way, the packet loss is 0%, while the other way, there is 90% loss. Both machines are located in t

  • TRYING TO DOWNLOAD ITUNES---NOT WORKING

    got my new 30gb ipod today. went to the apple web site to download itunes. I clicked on download & the screen shifted to the next screen which indicated it had downloaded. Nothing happens after that. No install wizzard or equivalent. Background....I

  • Bw statistic

    Hi everybody, I work with BW statistics queries and need some details about Runtime query (0BWTC_C10_Q014). I dont understand what contain the column with the key figure "Validity Period Cat." . Really I need your help. Thankfully,

  • ORA-12547 for rsh -l sid adm dbhost "brconnect -u / -f state"

    Hi, I have problem with db13 (PI711, kernel 720, Oracle 11.2.0.3) after split&migrate to linux. BR0301E SQL error -12547 at location db_connect-2, SQL statement: 'CONNECT /' ORA-12547: TNS:lost contact. but: 1.  <dbhost>:ora<sid>$ "brconnect  -u /  -

  • 'unknown error 13019'

    Hi Has any one come across 'unknown error 13019' when syncing their iPod Touch? Please help Thanks Andi