Applescript and Image Events

The following script works correctly:
property openTypes : {"PDF", "com.adobe.pdf", "BMP", "com.microsoft.bmp", "JPEG", "JPEG2", "jpg", "public.jpeg", "PICT", "com.apple.pict", "PNG", "public.png", "PSD", "com.adobe.photoshop-image", "TIFF", "public.tiff"}
global eventsFolder, ProcessedfolderName, events_Folder
on runConversion(theItems)
    activate "Finder"
    set saveFolder to choose folder with prompt "Save resized pictures where?" without multiple selections allowed and invisibles
    tell application "Image Events"
        launch
        set newWidth to 120
        if (count items of theItems) is greater than 0 then
            repeat with anItem in theItems
                set theName to the name of anItem
                tell application "Finder" to set myNewFileName to (saveFolder as string) & "tmb_" & theName
                set imageFile to (open anItem)
                scale imageFile to size newWidth
                save imageFile as PNG in file myNewFileName
                close imageFile
            end repeat
        else
            display dialog "Nothing to convert."
        end if
    end tell
end runConversion
mount volume someVolume
set root_Folder to root_Folder as alias
set events_Folder to events_Folder as alias
set theStr to (current date) as string
set d to date theStr
set ProcessedfolderName to ((month of d as integer) & "_" & day of d) as text
tell application "Finder"
    set events_Folder to events_Folder as alias
    set ProcessedfolderName to ((month of d as integer) & "_" & day of d) as text
    set new_FileFolder to make new folder at events_Folder with properties {name:ProcessedfolderName}
    move (every file of events_Folder whose name ends with ".png") to new_FileFolder
    set oldFiles to every file of events_Folder
    set thecount to number of items of oldFiles
end tell
set theFiles to choose file with prompt "Choose the files" of type openTypes with multiple selections allowed without invisibles
runConversion(theFiles)
activate
BUT if I modify it to the following, it gets hung up on "scale imageFile to size newWidth"
error "The variable imageFile is not defined." number -2753 from "imageFile"
Maybe it has something to do with the line
'set theFiles to choose file with prompt "Choose the files" of type openTypes with multiple selections allowed without invisibles'
which is not in the broken script.
The broken script is as follows:
property openTypes : {"PDF", "com.adobe.pdf", "BMP", "com.microsoft.bmp", "JPEG", "JPEG2", "jpg", "public.jpeg", "PICT", "com.apple.pict", "PNG", "public.png", "PSD", "com.adobe.photoshop-image", "TIFF", "public.tiff"}
global eventsFolder, ProcessedfolderName, new_FileFolder, imageFile
on runConversion(theItems)
    activate "Finder"
    set saveFolder to new_FileFolder
    set theItems to every file of the saveFolder
    tell application "Image Events"
        launch
        set newWidth to 120
        if (count items of theItems) is greater than 0 then
            repeat with anItem in theItems
                set theName to the name of anItem
                tell application "Finder" to set myNewFileName to (saveFolder as string) & "tmb_" & theName
                set imageFile to (open anItem)
                scale imageFile to size newWidth
                save imageFile as PNG in file myNewFileName
                close imageFile
            end repeat
        else
            display dialog "Nothing to convert."
        end if
    end tell
end runConversion
mount volume mountVolume
set root_Folder to rootFolder as alias
set events_Folder to events_Foler as alias
set theStr to (current date) as string
set d to date theStr
set ProcessedfolderName to ((month of d as integer) & "_" & day of d) as text
tell application "Finder"
    set ProcessedfolderName to ((month of d as integer) & "_" & day of d) as text
    set new_FileFolder to make new folder at events_Folder with properties {name:ProcessedfolderName}
    move (every file of events_Folder whose name ends with ".png") to new_FileFolder
    set oldFiles to every file of events_Folder
    set thecount to number of items of oldFiles
end tell
set theFiles to every file of new_FileFolder
runConversion(theFiles)
activate

Several lines of the “broken” script seem to be badly written, for example:
    set root_Folder to rootFolder as alias -- rootFolder instead of root_Folder
    set events_Folder to events_Foler as alias -- Foler instead of Folder
Message was edited by: Pierre L.

Similar Messages

  • AppleScript and Recurring Events

    I'm trying to create an AppleScript that will, essentially, e-mail every event for the week to Remember The Milk so that, on the iPhone, I can pull up Appigo's To Do and get an overview of everything I have to do for the day-- both RTM tasks and iCal events. For all non-recurring events, I'm in great shape.
    The problem, of course, is the way iCal handles recurring events and start dates. Because it considers the start date to be only the first occurrence of a recurring event, they're excluded when start dates are used to get only those events that occur within a specific timeframe.
    I can get all of my recurring events rather easily (although if anyone knows of better way than +...whose recurrence is not ""+ I'd be in your debt), but I don't want to sync every instance of the event. When regular appointments are canceled/rescheduled, I don't want to have to change them in multiple locations.
    Is there a way to get AppleScript to work with only a single occurrence of a recurring event? (Or, preferably, several single occurrences, considering that I've got anywhere between ten and thirty recurring events, depending on the week.)
    I had the thought of, before syncing every week, deleting any previous occurrence of a recurring event, but the script prompts me for the number of days I want to sync each time it runs, and I can foresee wanting to sync two or three weeks at a time, in which case simply deleting the event doesn't really solve the problem anyway.
    null

    Several lines of the “broken” script seem to be badly written, for example:
        set root_Folder to rootFolder as alias -- rootFolder instead of root_Folder
        set events_Folder to events_Foler as alias -- Foler instead of Folder
    Message was edited by: Pierre L.

  • Images and image maps do not respond to events on Safari

    Hello everyone,
    We have been experiencing issues with events not responding to images associated with image maps, on Safari browser. After the DOM is loaded with new image and corresponding image maps, events such as mouseover and click observing this divs do not respond or get triggered. DOM seems to be updated correctly but behaves differently (and it works correctly in all other browsers except Safari).
    This behaviour is only noticed in Safari browser running both on Windows and Mac. (Tested on Safari Version 3.1.1 on running on Windows and Mac)
    For you all to have a closer look at this issue, I have created a sample that has this problem, similar to one we experienced during one of our recent projects. Please click on the link below to get to the sample (I recommend you to try this either in Firefox or IE before you do on Safari)
    http://www.hivegroup.com/safari/test.html
    (In the above sample,
    - the javascript code initializes the DOM with image and image map
    - assigns two event listeners to the div containing this image and image map
    - when mouse pointer brought over the image, it shows the area id in the 'mobox' div
    - when clicked, DOM is updated with a new image and new corresponding image map, assigns new event listeners and should continue with the same kinda behaviour it did for the first image (but doesn't in Safari browser))
    All inputs on this issue are welcome and greatly appreciated.
    Thanking you in advance.
    Regards,
    Shashi.

    Let me explain what the pink area is. Like the first image that contains two white boxes, the pink area (as you call it) is a new image (containing four pink areas or boxes having an area id denoted to each) that imgDiv occupies after the 'click' event occurs.
    Yep, i gathered that from seeing it work on firefox...
    The point that I'm trying to make here is, there shouldn't be any difference in behaviour when imgDiv holds first image (two white boxes) or the second image (four pink boxes) that you get after we click on image or the third image (containing 6 boxes, multiple colors) which you won't be able to reach in safari browser.
    well... I can reach them, but only via the blue space.
    . We'll notice change in the red box displaying target id only when we mouse over a new area that is not currently being displayed in the red box.
    except in webkit for safari 2, where thered bpx content sticks at whatever it was when the first image was clicked, unless mouse is moved to the 'all area', and then it sticks on imgdiv.
    I completely understand what you see in safari 2. But are you saying there's some error in my script ? If so could you please point out and justify.
    I dunno Shashi, just pointing out the errors that Safari 2 reports when I view your test page, in the hope it might help. I know little of javascript

  • Applescript Image Events appears to have memory leak (or I don't know what I am doing)

    Using Image Events to create images and thumbnails for a website. The following code results in very large memory leaks in Image Event process. I have documented results of test runs in the comments.
    The leak (or poor coding on my part) results in a total system halt if I attempt to process more than about 400 images at a time. Basically, I run out ot physical memory. I am running a new model 13" MBP with 8GM RAM.  I have to manually stop Image Events to reclaim the memory (or reboot of course).
    Any help/suggestions would be appreciated.
    (* test memory leak in Image Events *)
              tests with 58 photos selected in iPhoto
              5.7 MB left in Image Events after run with only open and close
              22.0 MB left in Image Events after run with open, save and close
              45.9 MB left in Image Events after run with open, scale, save and close
              A run with 382 photos selected used OVER 3.8 GB (gigabytes) and the
              mac ran out of physical memory so I had to stop the test.
    tell application "Finder"
              set imageFolder to folder "test" of home as alias
    end tell
    tell application "iPhoto"
              set currPhotoList to the selection
              repeat with currPhoto in currPhotoList
                        log name of currPhoto as string
                        set theImagePath to image path of currPhoto
                        tell application "Image Events"
      launch
                                  set theImage to open theImagePath
      scale theImage to size 128
      save theImage in imageFolder as JPEG with icon
      close theImage
                        end tell
              end repeat
    end tell
    --- end of code example

    Does the following code do any difference? Most likely no I guess… but better try than nothing.
    tell application "Finder"
        set imageFolder to folder "test" of home as text -- instead of “as alias” (see theTargetPath below)
    end tell
    set theImagePaths to {}
    set theImagePathsRef to a reference to theImagePaths -- faster with big lists
    tell application "iPhoto"
        set currPhotoList to the selection
        repeat with currPhoto in currPhotoList
            log name of currPhoto as string
            get POSIX file (image path of currPhoto) as alias -- faster ?
            copy result to the end of theImagePathsRef
        end repeat
    end tell
    tell application "Image Events"
        launch
        repeat with theImagePath in theImagePaths
            set theImage to open theImagePath
            scale theImage to size 128
            set theTargetPath to (imageFolder & name of theImagePath)
            save theImage in theTargetPath as JPEG with icon
            close theImage
        end repeat
    end tell

  • Applescript to change image resolution using image events

    Does anyone have an applescript to change image resolution using image events in OSX? I want to optimize my images for iWeb. I want to use a shell script in an applescript as a droplet or as a service in Automator. I'd like to leave the original intact.

    For what type of use in iWeb are these photos intended? If it's for adding to a page (not a photo or album page) iWeb does a great job of optimizing. See my post in this topic: Re: Photo Resolution in iWeb.
    You can optimize an entire site with an application like Web Site Maestro. It can reduce the site's size by up to 49%. Here's the settings available for the optimization:
    Click to view full size
    It's very effective.
    OT

  • Help needed with Image Events problem

    Hi there I'm writing what I thought was a simple script to convert a folder full of images from jpg to tiff. But the script fails when trying to convert the first image in the folder. Instead of converting the image, Preview opens with the image shown and I get this error message: error "The variable ImageRef is not defined." number -2753 from "ImageRef".
    I have seen some posts about other people having the same problem, but I haven't seen any solutions.
    Here's the script.
    on run
    tell application "Finder"
    set PicturesFolder to ((path to home folder) as string) & "Pictures:SenseCam" as alias
    set Photographs to (get entire contents of PicturesFolder) as alias list
    end tell
    tell application "Image Events"
    launch
    repeat with Photo in Photographs
    if (Photo as string) ends with "jpg" then
    set ImageRef to open Photo
    save ImageRef in Photographs as TIFF
    close ImageRef
    end if
    end repeat
    end tell
    tell application "Finder"
    repeat with Photo in Photographs
    delete Photo
    end repeat
    end tell
    end run
    Thanks in advance for any help.
    John

    Hello
    You may try something like the modified code below.
    Noticiable changes :
    #1 - Removed the parentheses. Your original code won't yield alias list but a list of finder objects, which is the reason why Preview opens the image. (The statment 'open finderObject' behaves the same as double clicking it in Finder)
    #2 - Only delete the original jpeg files which are converted to tiff.
    #3 - Build new path for converted image.
    #4 - Save in new path. (When saving image in a format other than its original format, always save the image to a new file and do not attempt to overwrite the source file.)
    cf.
    http://www.macosxautomation.com/applescript/imageevents/08.html
    on run
    tell application "Finder"
    set PicturesFolder to (path to home folder as string) & "Pictures:SenseCam:" as alias
    set Photographs to get entire contents of PicturesFolder as alias list -- #1
    end tell
    set DonePhotos to {} -- #2
    tell application "Image Events"
    launch
    repeat with Photo in Photographs
    set Photo to Photo's contents
    set oldPath to Photo as string
    if oldPath ends with ".jpg" then
    set newPath to oldPath's text 1 thru -5 & ".tif" -- #3
    set ImageRef to open Photo
    save ImageRef as TIFF in newPath -- #4
    close ImageRef
    set end of DonePhotos to Photo -- #2
    end if
    end repeat
    end tell
    tell application "Finder"
    delete DonePhotos -- #2
    end tell
    end run
    Hope this may help,
    H

  • Quality of JPEG when being converted by Folder Actions (Image Events)

    I take a lot screenshots with Command + Shift + 3/4. They are in PNG and I love them. Yet, I need to send them via email sometimes.
    I convert them to JPEG using Preview, but it is time-consuming when especially I have hundreds of them.
    I have just learnt that it is possible to do convert in batch using Folder Actions. However, I meet few very serious problems.
    1. In Preview, I could choose the quality of JPEG before converting. But, there is no such option in Folder Actions. I even searched online to try to modify the script and it seems that nobody cares about the quality of converted JPEG.
    My question: What is the quality of JPEG converted? And, is it possible to modify it?
    2. Since I do not know the quality of conversion using Folder Actions, I tried different qualities using Preview and match the outputs with those using Folder Actions. I got no result. As Preview is using Core Image as the processing architecture.
    My question: What is the image processing architecture adopted by Image Events?
    3. If the quality is unchangeable, can anyone teach me how to write a new script to do the conversion using Preview?
    I really hope Mac OS gurus could explain these to me and possibly solve my problems. I am interested to learn the AppleScript part to modify it.
    Thank you very much.

    It is the original folder action script from Mac OS. Here is the copy.
    Could you help me as well where to add the "compression level"? Also, what do "high", "low" and "medium" mean, in % just like Preview, if they use the same image processing architecture?
    Again, thank you very much for quick reply.
    ================
    Image - Duplicate as JPEG
    This Folder Action handler is triggered whenever items are added to the attached folder.
    The script creates a JPEG version of the file, but leaves a copy of the file
    in its original format. If the original file is already in JPEG format, the script does
    not duplicate the file.
    Copyright © 2002–2007 Apple Inc.
    You may incorporate this Apple sample code into your program(s) without
    restriction.  This Apple sample code has been provided "AS IS" and the
    responsibility for its operation is yours.  You are not permitted to
    redistribute this Apple sample code as "Apple sample code" after having
    made changes.  If you're going to redistribute the code, we require
    that you make it clear that the code was descended from Apple sample
    code, but that you've made changes.
    property done_foldername : "JPEG Images"
    property originals_foldername : "Original Images"
    property newimage_extension : "jpg"
    -- the list of file types which will be processed
    -- eg: {"PICT", "JPEG", "TIFF", "GIFf"}
    property type_list : {"TIFF", "GIFf", "PNGf", "PICT"}
    -- since file types are optional in Mac OS X,
    -- check the name extension if there is no file type
    -- NOTE: do not use periods (.) with the items in the name extensions list
    -- eg: {"txt", "text", "jpg", "jpeg"}, NOT: {".txt", ".text", ".jpg", ".jpeg"}
    property extension_list : {"tif", "tiff", "gif", "png", "pict", "pct"}
    on adding folder items to this_folder after receiving these_items
              tell application "Finder"
                        if not (exists folder done_foldername of this_folder) then
      make new folder at this_folder with properties {name:done_foldername}
                        end if
                        set the results_folder to (folder done_foldername of this_folder) as alias
                        if not (exists folder originals_foldername of this_folder) then
      make new folder at this_folder with properties {name:originals_foldername}
                                  set current view of container window of this_folder to list view
                        end if
                        set the originals_folder to folder originals_foldername of this_folder
              end tell
              try
                        repeat with i from 1 to number of items in these_items
                                  set this_item to item i of these_items
                                  set the item_info to the info for this_item
                                  if (alias of the item_info is false and the file type of the item_info is in the type_list) or (the name extension of the item_info is in the extension_list) then
                                            tell application "Finder"
                                                      my resolve_conflicts(this_item, originals_folder, "")
                                                      set the new_name to my resolve_conflicts(this_item, results_folder, newimage_extension)
                                                      set the source_file to (move this_item to the originals_folder with replacing) as alias
                                            end tell
      process_item(source_file, new_name, results_folder)
                                  end if
                        end repeat
              on error error_message number error_number
                        if the error_number is not -128 then
                                  tell application "Finder"
      activate
      display dialog error_message buttons {"Cancel"} default button 1 giving up after 120
                                  end tell
                        end if
              end try
    end adding folder items to
    on resolve_conflicts(this_item, target_folder, new_extension)
              tell application "Finder"
                        set the file_name to the name of this_item
                        set file_extension to the name extension of this_item
                        if the file_extension is "" then
                                  set the trimmed_name to the file_name
                        else
                                  set the trimmed_name to text 1 thru -((length of file_extension) + 2) of the file_name
                        end if
                        if the new_extension is "" then
                                  set target_name to file_name
                                  set target_extension to file_extension
                        else
                                  set target_extension to new_extension
                                  set target_name to (the trimmed_name & "." & target_extension) as string
                        end if
                        if (exists document file target_name of target_folder) then
                                  set the name_increment to 1
                                  repeat
                                            set the new_name to (the trimmed_name & "." & (name_increment as string) & "." & target_extension) as string
                                            if not (exists document file new_name of the target_folder) then
      -- rename to conflicting file
                                                      set the name of document file target_name of the target_folder to the new_name
                                                      exit repeat
                                            else
                                                      set the name_increment to the name_increment + 1
                                            end if
                                  end repeat
                        end if
              end tell
              return the target_name
    end resolve_conflicts
    -- this sub-routine processes files
    on process_item(source_file, new_name, results_folder)
      -- NOTE that the variable this_item is a file reference in alias format
      -- FILE PROCESSING STATEMENTS GOES HERE
              try
      -- the target path is the destination folder and the new file name
                        set the target_path to ((results_folder as string) & new_name) as string
                        with timeout of 900 seconds
                                  tell application "Image Events"
      launch -- always use with Folder Actions
                                            set this_image to open file (source_file as string)
      save this_image as JPEG in file target_path with icon
      close this_image
                                  end tell
                        end timeout
              on error error_message
                        tell application "Finder"
      activate
      display dialog error_message buttons {"Cancel"} default button 1 giving up after 120
                        end tell
              end try
    end process_item

  • Bridge CS6: How do you write a script to assign a shortcut to "Batch" and "Image Processor"?

    Many times a day I need to access "Batch" and "Image Processor" in Bridge.
    There is no shortcut, so I have to go the Tools-Photoshop-Batch and Tools-Photoshop-Image Processor menu - the items I need are locked into a second level menu.
    Which is impractical.
    I remember, when I started out with Photoshop many years ago, I downloaded "Deke Keyes" from Deke McClelland, which included keystrokes for "Batch" and "Image Processor".
    From the Bridge forum I learned that you cannot assign shortcuts in Bridge CS6.
    So the general opinon was that a script was used to assign the shortcuts.
    Could you please tell me how to do that?
    Thanks!
    PS: I tried to assign shortcuts via the Mac OS X Mountain Lion keyboard preferences (applications), but it did not work.

    Hi,
    in the exit:Event of the 1st date field add this FormCalc script:
    DateField2 = Num2Date(Date2Num($.formattedValue, "DD.MM.YYYY") + 21, "DD.MM.YYYY")
    You may have to change th date pattern  "DD.MM.YYYY" in the way you need it.

  • Applescript and automator

    I have studyed html for 3 days and wordpress for 3 days , word , excel for 5 days, and llustrator and photoshop 13 yeas ago for 6 months.
    and still now its so hard to understand some how.
    but I am in need of understading now with the printed documents from my computer.
    and I wonder , so there are many defferent way to communicate with anyone out side of the world, right?
    like I know email , fax, facetime,
    but there are other way now I think because of the documents I found.
    and also with applescript and automator can do anything possible like even the child can click one and start conecting etc..
    I have the copy from its ,
    does anyone have time to explain me what it is?
    It's not that of teenager who doesn't want paretns to know or else,
    but I am quite serious for my situations.
    Please Help !
    Mac OS snow leopard to lion to moutain lion,,,,,
    but I don't know when it started yet.

    Using JavaScript to script System Events wouldn't be any better, since it uses the same Apple Events mechanism (how well it uses it is another topic).  To hold down a key you would need to use something that has access to the deeper system APIs, most likely using Xcode.
    And yes, your code snippet will press the arrow key 5 times (I am guessing that the missing space in key code is a typo).  You can place the cursor in a bunch of text in another application such as TextEdit, and use your script to activate it before performing the key codes to get a better idea of what is happening (trying to reposition the cursor in the Script Editor will reveal a bug with the delay command).

  • Is it possible to duplicate (new and existing) events and paste them into a new calendar automatically?

    I have four google calendars connected to my mac via CalDav, and i need to have all the events in all those four calendars into a new one also in google calendar. So, i want to know if it is possible to configure an automator action or an applescript that duplicate events (the old ones and the new events i'll create) of some calendars into a new one. It would be like grouping some calendars to create a new one, without deleting those calendars, do you understand? Is it possible? I want to made this as transparent for me as possible, automatic.
    Thanks for helping! and sorry about my english

    If you are importing from a CD, you can tell iTunes not to automatically import the CD (Edit->Preferences: When you insert a CD: Ask to Import CD). That's what I do. I then edit the track names and album artists to be what I want before I import the CD. After the import is done, I go back to the CD (by album name in the search bar) and correct the album art.
    The other way (which is what you need to do if you are downloading digital files, such as Amazon MP3) is to remember the "Recently Added" playlist. That's a subset of albums added in the last few weeks, so it presumably should be easier to find the new albums. Again, you can go there and edit the information.
    If "Recently Added" is still got too much, you can edit the smart playlist to shorten the time period and create a "Really Recently Added" Playlist.
    I'm familiar with managing music in large libraries: I've been recording from LP into my iPod this week (plus adding some CDs I had forgotten about), and currently have 26878 tracks.

  • Strange behavior with Zoom and Image control

    HELP - I have a strange behavior (bug?) with using Zoom
    effect on an Image that has been placed on a Canvas. I am using
    dynamically instantiated images which are placed on a canvas inside
    a panel. I then assign a Zoom IN and Zoom Out behavior to the
    image, triggered by ROLL_OVER and ROLL_OUT effect triggers. THE BUG
    is that the image jumps around on the Zoom OUT and lands on a
    random place on the canvas instead of coming back to the original
    spot. This is especially true if the mouse goes in and out of the
    image very quickly. HELP -- what am I doing wrong? Computer = Mac
    OS X 10.4.9 Flex 2.0.1
    Here's a simple demo of the bug -- be sure to move the mouse
    in and out rapidly:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="setUp();">
    <mx:Script><![CDATA[
    import mx.events.EffectEvent;
    import mx.effects.Fade;
    import mx.effects.Zoom;
    import mx.rpc.events.ResultEvent;
    import flash.display.Sprite;
    import mx.core.UIComponent;
    import mx.controls.Image;
    private var zoomIn:Zoom;
    private var zoomOut:Zoom;
    private function setUp():void {
    var image:Image = new Image();
    image.id = "album_1_1";
    image.x = 200;
    image.y = 200;
    image.width = 64;
    image.height = 64;
    image.source = "
    http://s3.amazonaws.com/davidmccallie/album-128.jpg";
    image.addEventListener(MouseEvent.ROLL_OVER, doZoom);
    image.addEventListener(MouseEvent.ROLL_OUT, doZoom);
    myCanvas.addChild(image);
    zoomIn = new Zoom();
    zoomIn.zoomHeightTo = 2.0;
    zoomIn.zoomWidthTo = 2.0;
    zoomIn.captureRollEvents = true;
    zoomIn.suspendBackgroundProcessing = true;
    zoomOut = new Zoom();
    zoomOut.zoomHeightTo = 1.0;
    zoomOut.zoomWidthTo = 1.0;
    zoomOut.captureRollEvents = true;
    zoomOut.suspendBackgroundProcessing = true;
    private function doZoom(event:MouseEvent):void {
    var image:Image = Image(event.currentTarget);
    if (event.type == MouseEvent.ROLL_OVER) {
    zoomIn.target = event.currentTarget;
    zoomIn.play();
    } else if (event.type == MouseEvent.ROLL_OUT) {
    zoomOut.target = event.currentTarget;
    zoomOut.play();
    ]]>
    </mx:Script>
    <mx:Panel width="100%" height="100%"
    layout="absolute">
    <mx:Canvas id="myCanvas" width="100%" height="100%">
    </mx:Canvas>
    </mx:Panel>
    </mx:Application>

    There must be bugs in the Zoom effect code -- I changed the
    Zoom to Resize in the above code, and it works perfectly. Of
    course, Resize is not as nice as Zoom because you can't set the
    resize to be around the center of the image, but at least it works.
    Does anyone know about bugs in the Zoom effect?

  • Image Events not resizing tiff

    Hello,
    I have been trying to get some results from Image events for 5 hours now.
    Below is what I will use to express the issue I am encountering.
    When running the following script in script editor it appears to do what is asked of it but in the end the file is unchanged.
    It is almost as if Image Events is not working.
    Would someone please provide a step of troubleshooting for me?
    When I use return I get the file I selected.
    ====Script=====
    set this_file to choose file
    try
    tell application "Image Events"
    launch
    set this_image to open this_file
    scale this_image to size 318
    pad this_image to dimensions {320, 240}
    save this_image with icon
    return this_image
    close this_image
    end tell
    on error error_message
    display dialog error_message
    end try
    ====END Script====
    Thank you very much.

    Thanks for checking this Pierre.
    What I meant by saying it appears to do what is asked of it... is that I didn't receive any errors.
    I just did a major edit on the post because it was that my tiff files I was trying to process were CMYK. I converted them to RGB in Photoshop and they processed just fine.
    Not a solution though. I don't want to have to go through Photoshop because I have thousands of images to process.
    I tried to find the command to convert from CMYK to RGB in Image Events and can't find that.
    Can someone help me with the command to do that conversion in Image Events or at least without having to run Photoshop to do it?
    Thank you so very much in advance.
    Jeff
    Message was edited by: Jeffrey DeRousse
    Message was edited by: Jeffrey Derousse

  • Image Events save as PICT broken?

    An old script that worked in Lion is not working in Mountain Lion.
    Here is a test example:
    tell application "Image Events"
      launch
              set theImage to open "/tmp/c13.jpg"
              save theImage as PICT in file "/tmp/image.pict"
      close theImage
    end tell
    If the output file already exists, this script does nothing and does not complain. If the output file does not already exist, I get an error that the image "doesn't understand the save message".
    Other image file formats besides PICT work fine.
    Any ideas?

    Hi,
    The QuickDraw API (Macintosh PICT format) have long been obsolete (they've mostly been
    deprecated since Mac OS X 10.4).  But we still use them in a few places
    (in 32-bit mode) for backwards compatibility. (QuickDraw APIs are unavailable in 64-bit mode).
    Apple will remove the 32-bit system libraries in some future version of OS X and dropping support for 32-bit apps.
    Solution : Try selecting 'Open in 32 Bit Mode' in the Finder's info window for the application "Image Events"
    I know it works for Preview on OS X 10.8 (it can still open PICT format), but I don't know for "Image Events".

  • Using Applescript and Automator to manage files and folders

    Hi all.
    I need to make a simple action via applescript and-or automator to take the file it's been applied to (via the services) create a folder around it with the same name as the file.
    So far, I've searched the web, found some solutions but none are really working.
    Here's the script I found :
    set myFolder to findFolder()
    tell application "Finder" to set myFiles to files of myFolder as alias list
    repeat with aFile in myFiles
      set bName to my baseName(aFile)
      tell application "Finder"
      set folderExists to exists folder bName of myFolder
      if not folderExists then make new folder at myFolder with properties {name:bName}
      move aFile to folder bName of myFolder
      end tell
    end repeat
    ---------------- HANDLERS ----------------
    on baseName(myFile)
      tell application "System Events" to set {fileName, fileExt} to {name, name extension} of myFile
      return text 1 thru ((get offset of "." & fileExt in fileName) - 1) of fileName
    end baseName
    on findFolder()
      activate application "SystemUIServer"
      -- Bug pointed out by Lauri Ranta http://www.openradar.me/9406282
      tell application "Finder"
      activate
      set mySelection to (get selection)
      if mySelection ≠ {} then
      set mySelection to first item of (get selection)
      if mySelection's class = folder then
      set currentFolder to mySelection
      else if mySelection's class = document file then
      set currentFolder to parent of mySelection
      else if mySelection's class = alias file then
      set currentFolder to original item of mySelection
      end if
      else
      set currentFolder to target of front Finder window
      end if
      end tell
      return (currentFolder as alias)
    end findFolder
    And here's a page where they explain how to use automator and the Services to do what I <allmost> want, with some adaptation.
    But it still doesn't work.
    http://hbase.net/2011/08/17/move-selected-files-into-a-new-folder-using-applescr ipt-and-automator/
    So if anybody has an idea n how I could do this ?
    It It could either be a folder action (I drag and drop the files into a folder and boom, they get their folder around them)that I would set on a folder on a network drive, or locally, it doesn't matter, or a service (right clic on the file and boom folder around it.
    So if anyone could help with this I'd be grateful...

    Hi,
    Make an Automator Service (Service receives selected "Files or Folders"  in the "Finder.app").
    Use this script in the "Run AppleScript" action:
    on run {input, parameters}
        tell application "Finder"
            repeat with aFile in input
                if class of (item aFile) is not folder then
                    set {tName, fileExt} to {name, name extension} of aFile
                    if fileExt is not missing value and fileExt is not "" then
                        set tName to text 1 thru -((count fileExt) + 2) of tName
                        tell (get container of aFile)
                            if not (exists folder tName) then make new folder at it with properties {name:tName}
                            move aFile to folder tName
                        end tell
                    end if
                end if
            end repeat
        end tell
    end run
    This script work on files with a name extension.

  • I updated iphoto and images weren't visible.

    I updated iphoto and images weren't visible.  Still in the library but not visible.. did all the normal start up fixes like rebuilding thumbnails, database etc --- bt nothing worked...
    I copied images folders ORIGINAL MODIFIED etc -to an external harddrive and tried to restore my library from time maching - but now it tells me I don't have the memory...
    Of course I deleted the 'new' library and tried ... still the same information.
    I am now copying my time machine iphoto library to an external harddrive - but what is the go with this?  I've also lost my iphoto books that took hours to build...
    I'm devastated!
    Any help would be appreciated!

    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.>Click on the Add Library button,
    2 -  select the library you want to add from those in the selection window.
    3 - make sure that in the rebuild window the checkbox  "Scavange orphaned photos" is checked.
    4 - now that the library is listed in the left hand pane of iPLM, click on your library and go to the Library ➙ Rebuild Library menu option
    5 - in the next  window name the new library and select the location you want it to be placed. Click on the Create button.
    Note 1: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments. However, books, calendars, cards and slideshows will be lost.
    Note 2:  Your current library will be left untouched for further attempts at a fix if so desired.

Maybe you are looking for

  • Create sales order with reference to contract

    Hi, I have to create sales orders with reference to a contract. When I do the recording on lsmw the line items in the sales order are assigned a number from sap. I need to keep the line item numbers the same as per the contract. Any advice appreciate

  • Commons-logging error when starting Flex2 in JRun

    Created new JRun Server and deployed Flex2 to this server. Receiving this error when starting up this server instance. Starting Macromedia JRun 4.0 (Build 92909), logicerm2 server 07/13 22:23:28 info JRun Naming Service listening on *:2911 07/13 22:2

  • Using Acrobat PDF Browser Control in Vista

    Hi, I've written a .NET 2.0 WinForms application that uses the PDF Reader ActiveX to display PDF files. Everything works well in Win XP and Win 2003 Server, but when I install it in Vista, my app crashes. I get no useful error message, only "[My app

  • Would a gtx 970 fit in a Thinkcentr​e M82 3302 F2U?

    Length wise It should be big enough I think. However I am wondering if a gtx 970 would be too Thick and hit the serial data cables. I was wondering if anyone has a pc like mine and upgraded to a gtx 970 or tried to. Or if anyone is good at measuremen

  • Convert SapScripts into PDF

    I need to convert a few QM custom sapscript into PDF. I need to accomplish this and make the usability easier for the users I know we can do these 2 things 1. I know we can use the standard sap program RSTXPDFT4 to convert the spool to PDF. 2. Change