How to process received images in iChat/Messages with Applescript

Hello!
I want to process all received photos or videos with Applescript.
I try this:
using terms from application "Messages"
          on message received theMessage from theBuddy for theChat
                    if the length of theMessage is 0 then
  -- it means I received a picture or video file, but I can't get the file with Applescript, because theMessage is an empty string and not a file
                              set theMessage to "<lost photo or video content>"
                    else
  -- it's OK, I just got a text message and I can now save it or display or do something else with it
                    end if
          end message received
end using terms from
But if I receive a photo, theMessage is empty.
The event handlers "on completed file transfer" and "received file transfer invitation" don't work in this case, probably because it is not a file tranfer, but sort of an inline picture.
I use OS X 10.8.
Can somebody help me?

I have a similar question as well. I tried this for you and nothing happened.
on received file transfer invitation theFileTransfer
end received file transfer invitation
I think "completed file transfer" is regarding to the file being transfered to Apple's Server from your computer when a file is sent, but I'm not sure about "received file transfer invitation." Regarding it being an inline file, maybe try using the attachment class.
attachment n [inh. rich text] : Represents an inline text attachment. This class is used mainly for make commands.
elements
contained by rich text, characters, paragraphs, words, attribute runs.
properties
file (file, r/o) : The path to the file for the attachment  syn file name

Similar Messages

  • How can I open images in Photo Mechanic with AppleScript

    I need an AppleScript that displays a chosen folder of images in a Photo Mechanic as a Contact Sheet.
    A FileMaker script – with the help of a plug-in called Troi-File-Plug-in 2.8.2 - already allows me to navigate to the folder which opens on the desktop. The final step would be for the script to display the images in Photo Mechanic, where they can be viewed, captioned, edited etc. (The process can be performed manually by dragging the images onto the Photo Mechanic icon).

    Whenever I want a script to open a file with a certain app I use (e.g. FireFox)
    set thefile to choose file
    do shell script "open -a /Applications/Firefox.app " & quoted form of POSIX path of thefile
    if the app's name contains special characters or blanks you will have to quote it e.g.
    set thefile to choose file
    do shell script "open -a /Applications/'Final Cut Express.app' " & quoted form of POSIX path of thefile

  • How to get all images in indesign CS5 with javascript?

    Hi,everybody,
    How to get all images in indesign CS5 with javascript?I want to delete them.
    Anyone can give me some example codes?
    Thanks,
    Bridge

    Hey!
    This will remove all images from your InDesign document:
    var myLinks = app.activeDocument.links.everyItem().parent;
    for(var i = 0; i < myLinks.length; i++)
        myLinks[i].remove();
    Hope that helps.
    tomaxxi
    http://indisnip.wordpress.com/
    http://inditip.wordpress.com/

  • I keep receiving a server error message with the new beta version of iMessage.  What can I do to fix this?

    I keep receiving a server error message with the new beta version of iMessage.  What can I do to fix this?

    Ok I have a question.
    Why do you want to use Beta software? Especially since you are having this problem with it?
    Uninstall it and forget about it until it is released as a real piece of software.

  • How to read some images from file system with webdynpro for abap?

    Hi,experts,
    I want to finish webdynpro for abap program to read some photos from file system. I may make MIMES in the webdynpro component and create photos in the MIMES, but my boss doesn't agree with me using this way. He wish me read these photos from file system.
    How to read some images from file system with webdynpro for abap?
    Thanks a lot!

    Hello Tao,
    The parameter
       icm/HTTP/file_access_<xx>
    may help you to access the pictures without any db-access.
    The following two links may help you to understand the other possibilities as well.
    The threads are covering BSP, but it should be useful for WebDynpro as well.
    /people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
    http://help.sap.com/saphelp_sm40/helpdata/de/c4/87153a1a5b4c2de10000000a114084/content.htm
    Best regards
    Christian

  • How to process Large Image Files (JP2 220MB+)?

    All,
    I'm relatively new to Java Advanced Imaging, so I need a little help. I've been working on a thesis that involves converting digital terrain data into X3D scenes for future use in military training and applications. Part of this work involves processing large imagery data to texture the previously mentioned terrain data. I have an image slicer that can handle rather large files (200MB+ jpeg files). But it can't seem to process jpeg 2000 data. Below is an excerpt from my code.
    public void testSlicer(){
    String fname = "file.jp2";
    Iterator readers = ImageIO.getImageReadersByFormatName("jpeg2000");
    ImageReader imageReader = (ImageReader) readers.next();
    try {
    ImageInputStream imageInputStream = ImageIO.createImageInputStream(new File(fname));
    imageReader.setInput(imageInputStream, true);
    } catch (IOException ex) {
    System.out.println("Error: " + ex);
    ImageReadParam imageReadParam = imageReader.getDefaultReadParam();
    BufferedImage destBImage = new BufferedImage(256, 256, BufferedImage.TYPE_INT_RGB);
    Rectangle rect = new Rectangle(0, 0, 1000, 1000);
    //Only reading a portion of the file
    imageReadParam.setSourceRegion(rect);
    //Used to subsampling every 4th pixel
    imageReadParam.setSourceSubsampling(4, 4, 0, 0);
    try {
    destBImage = imageReader.read(0, imageReadParam);
    } catch (IOException ex) {
    System.out.println("IO Exception: " + ex);
    The images I am trying to read are in excess of 30000 pixels by 30000 pixels (15m resolution at 5 degrees latitude and 6 degrees longitude). I continually get an OutOfMemoryError, though I am pumping up the heap size to 16000MB when using the command line.
    Any help would be greatly appreciated.

    Hi,
    In general, an extra sizing for XI memory consumption is not required. The total memory of the SAP Web Application Server should be sufficient except in the case of large messages (>1MB).
    To determine the memory consumption for processing large messages, you can use the following rules of thumb:
    Allocate 3 MB per process (for example, the number of parallel messages per second may be an indicator)
    Allocate 4 kB per 1kB of message size in the asynchronous case or 9 kB per 1kB message size in the synchronous case
    Example: asynchronous concurrent processing of 10 messages with a size of 1MB requires 70 MB of memory
    (3MB + 4 * 1MB) * 10 = 70 MB With mapping or content-based routing where an internal representation of the message payload may be necessary, the memory requirements can be much higher (possibly exceeding 20 kBytes per 1kByte
    message, depending on the type of mapping).
    The size of the largest message thus depends mainly on the size of the available main memory. On a normal 32Bit operating system, there is an upper boundary of approximately 1.5 to 2 GByte per process, limiting the respective largest message size.
    please check these links..
    /community [original link is broken]:///people/michal.krawczyk2/blog/2006/06/08/xi-timeouts-timeouts-timeouts
    Input Flat File Size Determination
    /people/shabarish.vijayakumar/blog/2006/04/03/xi-in-the-role-of-a-ftp
    data packet size  - load from flat file
    How to upload a file of very huge size on to server.
    Please let me know , your problem is solved or not..
    Regards
    Chilla..

  • How to process inbound idoc in R/3 with status 75 - idoc received via qRFC?

    Hi gurus,
    we are using EOIO for source to R/3, and all the idocs a received in r/3 with this status. But they can't be processed from BD87. How to process these?
    Thanks,
    Olian
    Edited by: Olian Saludew on Sep 11, 2008 11:44 AM

    Hi,
    Idocs Works on tRFC Queues.
    Check this Report to Process Inbound Idocs with Specified Status.
    RBDAPP01
    Regards
    Seshagiri

  • How do you receive iMessages as text messages?

    I have my iMessage off, and my friend has her iMessage on. When she sends me iMessages I'm suppose to recieve them as text messages, but I don't receive them as all. She has her "Send as SMS" on. I don't know why I'm still not recieving them. Does the iMessage on my Macbook affect me from recieving iMessages from her? And how come I can't recieve text messages from her?
    I've tried this with my sister's phone with "Send as SMS" on and I can recieve her messages. So I'm assuming something's off on my friend's phone. Does the "Send & Recieve" have anything to do with this problem?
    Thanks!

    Have her delete the message thread and remove your email address from her contact for you.

  • OT: How can I manage a "Please Wait" message with this scenario?

    I have a page which allows you to paste in a potentially
    large list of zip
    codes.
    When you submit this page, the list is de-duped, and then
    checked against a
    table of ~22,000 zips for matches.
    Where and how in this process could I bring up a "Please
    Wait" message while
    the transaction is being completed?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================

    > you could also just use the PVII script on body load to
    show the
    > appropriate div - you could change the name in the" with
    the appropriate
    > switch statement.
    Ew. Double ew.
    I'm going to let it ride as is, until someone complains.
    Thanks for the
    neurons, though. Do you need them back? Or I should say, "you
    DO need them
    back"!
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "crash" <[email protected]> wrote in message
    news:[email protected]...
    > you could also just use the PVII script on body load to
    show the
    > appropriate div - you could change the name in the" with
    the appropriate
    > switch statement.
    >
    > It's my belief that some of your html elements will be
    able to show while
    > others are still being built. I guess I could be wrong
    on this, but I
    > think practically I'm right (ie, you can see elements on
    my page building
    > before the page is completely done).
    >
    > HTH,
    >
    > Jon
    >
    > "crash" <[email protected]> wrote in message
    > news:[email protected]...
    >> summation:
    >> In your SQL, at the bottom of the statement, you
    should be able to put a
    >> javascript call that will re-structure the
    visibility of the elements
    >> according to the variabels returned by the SQL. One
    page, reloaded once.
    >>
    >> My switch statement got a little convoluted. You
    should be able to just
    >> set one variable, or set one number and go from
    there (ie, if $v=3, hide
    >> other two), but i've not had any coffee or caffinne
    yet.
    >>
    >>
    ===========================================================
    >> Is the code in the third message on this post from
    the originating page?
    >> I took that it was, that it had a form, that form
    reloaded the same page?
    >>
    >> If so, you should be able to put a switch in there:
    >>
    >> switch($stage){
    >> case "upload":
    >> #this should be once the form has been completed
    >> $status=1; //status equal one, two or threee is one
    method you could
    >> use.
    >> break;
    >> case "complete"://you could aalso set a variable for
    each section, i
    >> think the one above is better, but this one made
    more sense right now,
    >> lol.
    >> #show the results,
    >> $resultsState="show";
    >> $formState="hide";
    >> $waitState="hide";
    >> break;
    >> case default:
    >> #empty, or first state, show the form to upload the
    data
    >> $live="form";
    >> break;
    >> }
    >>
    >> then, below:
    >>
    >> <div id="form" class="<?php echo $formState
    ?>">
    >> <form>
    >> whatever
    >> </form>
    >> </div>
    >>
    >> <div id="wait" class="<?php echo $waitState
    ?>">
    >> <img src="img/wait.gif" />
    >> </div>
    >>
    >> <div id="results" class="<?php echo
    $resultsState ?>">
    >> <h1>Results</h1>
    >> <p>stuff here</p>
    >> </div>
    >>
    >>
    >>
    >>
    >>
    >>
    >> "Murray *ACE*"
    <[email protected]> wrote in message
    >> news:[email protected]...
    >>>I can do that. I'm worried about passing the zips
    array (which has been
    >>>exploded from the input) to the process page. How
    would I best do that?
    >>>
    >>> --
    >>> Murray --- ICQ 71997575
    >>> Adobe Community Expert
    >>> (If you *MUST* email me, don't LAUGH when you do
    so!)
    >>> ==================
    >>>
    http://www.dreamweavermx-templates.com
    - Template Triage!
    >>>
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >>>
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >>>
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    >>> ==================
    >>>
    >>>
    >>> "crash" <[email protected]> wrote in
    message
    >>> news:[email protected]...
    >>>> THis is how I see the process, I guess I
    might not be following you:
    >>>>
    >>>> 1. User goes to form page, to submit zips.
    >>>> 2. User completes form, hits upload
    >>>> 3. Page refreshes itself, publishes please
    wait message (ie, could you
    >>>> not put an if [form submit] is true, echo
    this image, then begin the
    >>>> sql calculations)
    >>>> 4. As the calculations are finished, toggle
    visibility of image off,
    >>>> toggle div with results on.
    >>>>
    >>>> If that doesn't work, sorry, I completely
    misunderstand and will leave
    >>>> you be.
    >>>>
    >>>> "Murray *ACE*"
    <[email protected]> wrote in message
    >>>> news:[email protected]...
    >>>>> But then there's no opportunity to slam
    the waiting message up
    >>>>> there....
    >>>>>
    >>>>> --
    >>>>> Murray --- ICQ 71997575
    >>>>> Adobe Community Expert
    >>>>> (If you *MUST* email me, don't LAUGH
    when you do so!)
    >>>>> ==================
    >>>>>
    http://www.dreamweavermx-templates.com
    - Template Triage!
    >>>>>
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >>>>>
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >>>>>
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    >>>>> ==================
    >>>>>
    >>>>>
    >>>>> "crash" <[email protected]>
    wrote in message
    >>>>>
    news:[email protected]...
    >>>>>> couldn't you just have it reload the
    same page (isn't it anyway?).
    >>>>>>
    >>>>>>
    >>>>>> "Murray *ACE*"
    <[email protected]> wrote in message
    >>>>>>
    news:[email protected]...
    >>>>>>> Thanks, Joe. This troubles my
    mind, either way!
    >>>>>>>
    >>>>>>> --
    >>>>>>> Murray --- ICQ 71997575
    >>>>>>> Adobe Community Expert
    >>>>>>> (If you *MUST* email me, don't
    LAUGH when you do so!)
    >>>>>>> ==================
    >>>>>>>
    http://www.dreamweavermx-templates.com
    - Template Triage!
    >>>>>>>
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >>>>>>>
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    >>>>>>>
    http://www.macromedia.com/support/search/
    - Macromedia (MM)
    >>>>>>> Technotes
    >>>>>>> ==================
    >>>>>>>
    >>>>>>>
    >>>>>>> "Joe Makowiec"
    <[email protected]> wrote in message
    >>>>>>>
    news:[email protected]...
    >>>>>>>> On 23 Oct 2006 in
    macromedia.dreamweaver.appdev, Murray *ACE*
    >>>>>>>> wrote:
    >>>>>>>>
    >>>>>>>>> LOL - OK, see, I was
    hoping to avoid breaking it into separate
    >>>>>>>>> pages
    >>>>>>>>> like that, but that way
    looks like it'll work....
    >>>>>>>>
    >>>>>>>> You can just re-call the
    page which processes the form data, and
    >>>>>>>> check
    >>>>>>>> whether or not the
    processing has been done:
    >>>>>>>>
    >>>>>>>> <?php
    >>>>>>>> if ($dataWasProcessed) {
    >>>>>>>> echo '<h1>Thank you
    for using Murray's Data Processing</h1>';
    >>>>>>>> } else {
    >>>>>>>> // Code to process form goes
    here
    >>>>>>>> // Code to re-call page with
    $dataWasProcessed set goes here
    >>>>>>>> // How to set that var left
    as an exercise for the reader
    >>>>>>>> }
    >>>>>>>>
    >>>>>>>> Personally, I find that it
    troubles my mind less to do such things
    >>>>>>>> in
    >>>>>>>> separate files.
    >>>>>>>>
    >>>>>>>> --
    >>>>>>>> Joe Makowiec
    >>>>>>>>
    http://makowiec.net/
    >>>>>>>> Email:
    http://makowiec.net/email.php
    >>>>>>>
    >>>>>>>
    >>>>>>
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>
    >>
    >>
    >
    >

  • How to load a image after getting it with a file chooser?

    I'm still starting with JavaFX, and I simply would like to know how to load the image (e.g. png or jpg) that I selected using a FileChooser in the user interface. I can access the file normally within the code, but I'm still lost about how to load it appropriately. Every time I select a new image using the FileChooser, I should discard the previous one and consider the new one. My code is shown below:
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.paint.Color;
    import javafx.scene.layout.HBox;
    import javafx.scene.control.Button;
    import javax.swing.JFileChooser;
    import javafx.scene.image.ImageView;
    import javafx.scene.image.Image;
    var chooser: JFileChooser = new JFileChooser();
    var image;
    Stage {
        title: "Image"
        scene: Scene {
            width: 950
            height: 500
            content: [
                HBox {
                    layoutX: 670
                    layoutY: 18
                    spacing: 10
                    content: [
                        Button {
                            text: "Open"
                            action: function() {
                                if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(null)) {
                                    var imageFile = chooser.getSelectedFile();
                                    println("{imageFile.getCanonicalFile()}");
                                    image = Image{
                                        width: 640
                                        url:imageFile.getAbsolutePath()
                // Image area
                Rectangle {
                    x: 10
                    y: 10
                    width: 640
                    height: 480
                    fill: Color.WHITE
                ImageView {
                    x: 10
                    y: 10
                    image: bind image
    }Thank you in advance for any suggestion to make it work. :)

    As its name implies, the url param expect... an URL, not a file path!
    So, use {color:#8000FF}url: imageFile.toURI().toURL(){color} instead.

  • How to place multiple images of hand paintings with drop shadow effects on room backgrounds?

    I want to place multiple images of hand paintings with drop shadow effects on room backgrounds to make them look as if the paintings are hanged on the room walls. I know how to do it one by one, but that takes time and I want to do it in batch at once.
    I am quite a beginner for adobe photoshop CS6. I belive such an automated task is possible through 'Automated Batch' function and/or 'Create Droplet' function. Kindly share your expert opinion.

    If you want to go with Batch I would recommend creating an Action of more or less these steps:
    • set the resolution to the same as the background image’s
    • change the image from Background Layer to regular Layer if necessary
    • convert it to a Smart Object
    • add a Drop Shadow Layer Style to the image (do not use Global Angle)
    • place the background image (File > Place …)
    • move it behind the image layer
    • Image > Reveal All
    • make Selection from that layer’s transparency (cmd-click its icon in the Layers Panel) and use Image > Crop
    • select and transform the image layer to fit the intended position
    This would naturally work out best if the images had the same size and proportions.
    For the reflection on the floor duplicate the image, flip it vertically, move it in position and reduce its opacity to maybe 10%.
    Realistically you may have to hide it partially behind the pillows, a Vector Mask would be an option.

  • Place random image in Messages with Applescript - TextExpander

    I've been using Apple computers since '84 but I've never used Appplescript and was hoping for some help.
    I'd like to be able to place a random image in Messages with an Applescript through TextExpander. When I type my snippet into Messages  the Finder will open a random image from a folder using something like this:
    tell application "Finder"
    set randomImage to some file of folder "Mac HD:Users:me:photos:chat pics"
    get randomImage
    open randomImage
    end tell
    If I replace "Finder" with "Messages" it doesn't work. Do I need to combine 2 Applescripts to make this happen?
    TIA

    I tried using the following code, but it�din�t work.
    <%@ page import="java.io.*" %>
    <%
    // File (or directory) to be moved
    File file = new File("banner2.bmp");
    // Destination directory
    File dir = new File("banner");
    // Move file to new directory
    boolean success = file.renameTo(new File(dir, file.getName()));
    if (!success) {
    System.out.println("File was not successfully moved");
      // File was not successfully moved
    else{
    System.out.println("File was successfully moved");
    %>Andreas

  • How to process multiple images and each image has multipl links dynamically

    I saw this web site
    http://escience.invitrogen.com/ipath/iPath.jsp?cn=united+states&mapid=479&highlightGene=ADAM10
    when the small icons in the left map is clicked, the corresponding information of the icon display on the right. For one map, I know I could set up static URL for each gene name. But there are hundards of images, is there a way to dynamically process all the images instead hard code hundards of pages?
    Many thanks!

    The map is generated using Macromedia Flash. (I could tell because when I right-clicked on it I got a context menu including "About Macromedia Flash Player 8".) That's a programming language you could learn if you liked, but it has nothing to do with JSP.

  • How to get Receiver Id in EDI message

    I'm sending Invoic(810) from SAP to coustomer's.For each customer I have different receiver Id in EDI. How to handle this in XI.
    Thanks in advance.

    Hi Arjun,
    Create various receivers for each receiver in ID because receiver determination is done in ID not in IR.In receiver determination step use the condition editor and put the condition using XPATH for each receiver .
    Regards,
    **Grant points if my info is helpful

  • How to stop receiving Apple Support Communities messages

    Sick and tired of receiving dozens of messages.
    Not even able to send them to the junk box. These continue appearing like a cloud of locusts.
    Please, help !!!

    Unfortunately there is no unsubscribe from here so this needs to be fixed for the mails to stop.
    Usually the tech tip I wrote handles this issue if followed exactly as written. A lot if users will try to short-circuit the procedure or stop after they set the email preferences thinking that that is enough to fix it.
    As the tip states the email preferences only affect the future not what is happening now. So are you sure the actual notifications view is empty?
    If you look at the email you received it will indicate where it came from, a single post, a thread or a community. You can use that information to go to the particular area sending the email and turn it off  At the upper righthand side of the screen is an actions box. Make sure it says Receive email notifications. If it says Stop email notifications click it.
    If you still have problems a host can be notified to look at your account and try to fix the problem.
    regards

Maybe you are looking for