Using automator or applescript in Preview

Hi All,
I'd like to create a services menu item in Preview which does either of two things:
Open the file I'm currently viewing in Canon DPP raw processing software
OR
Check for a folder called "Keepers" in the same directory as the file I'm currently viewing. If it does not exist, create it, and then save a copy of the file into this folder.
However, I can't seem to find a way to create a services menu item in Preview - can anyone point me in the right direction?
Thanks

AFAIK, you can't create a service in Leopard using Automator or AppleScript. Check the AppleScript forum under OS X Technologies. See http://www.reynoldsftw.com/2009/08/automator-and-finder-interactions-in-os-x-10- 6/ for more on this.

Similar Messages

  • Use automator or applescript to capture and paste text

    Hi,
    I have two separate applications that need to share data and the developers are refusing to work with each other.
    Many years ago, I worked in QA but in an MS environment and we had tools that could capture images and text and input that back in. I was hoping I could do something similar with either automator or applescript.
    More specifically: This is for a dental office. The program that interfaces with the X-ray machine and processes the radiographs has a completely separate database from the patient management system. All of the patient information currently resides in a database within the patient management system so when we go to take an X-ray on a new patient, we have to retype all of the patient's information into the X-ray program. Double entry wastes time and has a higher probability of errors. I was hoping that after the assistant opens the patient's chart, either automator or applescript (or a 3rd party app) would be able to look at that screen, identify a few pieces of text that are always in the same place within the window (name, dob, gender, chart no., etc.) and copy that information and then paste it into the same fields in the X-ray program window.
    Any ideas?
    This is going to drive me nuts...
    Thanks!

    The real soluiton is to have a 3rd program that bridges them both.
    I've done exactly this for clients.  We normaly use Python because its open source and can link into any db out there.
    Your talking about "screen scrubbers".  I've used them to for software QC and automated testing.  They don't work anymore since "data execution protection" and memory protection in general became popular.
    You can write an Applescript (not sure Automator can handle it) to select any field of any running application and copy what is there, then paste it somepalce else.
    So, in theory, you could make a script you run at the blank screen that goes and copies over the currently selected patient in the other App.
    I'd really rather see the "bridge" app I mentioned first though.
    Add support for "LDAP" to your software requirements and this problem will go away.  I mean really, why let them spend money making a "patient" databse when they can use the services of an off-the-shelf LDAP server! 
    What is LDAP: http://en.wikipedia.org/wiki/LDAP

  • Using Automator with iPhoto or Preview

    I'm brand new to iMac. I love it, just having some learning curves.
    I have over 14,000 photos needing my watermark. How do I use automator to do this quickly instead of one photo at a time with preview?

    I didn't see a watermark option for graphics files in Automator.
    However, I think every photo processing app will batch convert all of your files and some of them have a watermark option.
    From a google search, Aperture provides a watermark option and batch processing.
    In Photoshop Elements, you can "Process Multiple Files…" which allows you to add a text watermark.
    I don't know if GraphicConverter can add a watermark.

  • Delete duplicates using Automator or applescript??

    Every time I move a photo from one iPhoto album to another I seem to create another duplicate-I'm really annoyed at the way iPhoto is written -who wants to go into a huge, unsorted- iPhoto library and delete stuff? Is there a way I can use automator or apple script to delete a photo from one album when it is moved to another? Also , when I use PhotoShop Elements to Browse for an album made in iPhoto-the only way I can find an album is to go through every year-iPhoto can't be this bad , can it?
    One more question-If I delete a photo in an album, it still remains in the library, how do I delete that without sorting through hundreds of pictures or using spotlight?
    mac book pro 17inch   Mac OS X
    mac book pro 17inch   Mac OS X (10.4.6)  

    whidbey:
    Welcome to the Apple Discussions. Photos you add to an album are only links to the original photo in the library. You are not duplicating files in doing so. The only time a file is duplicated is when you edit a photo and then there is a modified version created and placed in the Modified folder. You don't want to go about deleting files from within iPhoto Library folder via the Finder - Don't tamper with files in the iPhoto Library folder from the Finder.
    Albums in iPhoto are only virtual containers. There is no way you can find it and it's contents via PSE's browser. It does not exist outside of iPhoto. When you move a photo from one album to another and you don't want it in the first album you'll just have to delete it manually from that album. Remember if you delete a photo from the main library you'll be deleting every occurrence of it in your library.
    If you're trying to use Photoshop Elements to edit a photo, you don't need nor want to open it via the Finder. Instead, use iPhoto's preferences to use PSE as the editor of choice when you double click on a thumbnail in iPhoto. The only caveat to that is if you create a layered image or otherwise create a file that requires you to save it as a psd file, you must either flatten it and save as a jpg without a name change or do a Save As to the desktop and then import it as a new file. Any subsequent edit on that psd file can be make normally.
    Do you Twango?

  • How can I use Automator or AppleScript to get text from a web page and paste it in execl?

    I don't know how to make scripts or complexed automator workflows... that's why I'm asking.
    I'm trying to make a simple app or script to ask me what text to extract from a web page, like name, address and phone number of a web page and paste each one of these data in the righ cell of excel.
    I was thinking to promt a request from automator or an applescript to ask me which text to extract from the page or to look throught the HTML of the page to search for specific html tags, from which extracting text and then importing it, or paste it to the specified execl cell. Name in the name cell, address in the address cell and so on.
    Can somebody help me to make this script?
    If you know an alternative, like a software that already do this or another language to use, please tell.

    Try holding down the alt key as you mark the text to be copied. You can then copy columns to table text.

  • Is there a way to use Automator or AppleScript to convert iWork documents to Office Documents?

    I use iWork for my documents, but I sometimes need to convert a folder of iWork files to Microsoft Office files. It's one thing to convert one iWork document, but it's very tedious when I need to convert multiple documents. I'm hoping to be able to automate this process. By the way, I'm using the latest versions of the iWork applications, which I know have a lot less or no Automator support.

    Interestingly, the only Pages specific command in the AppleScript dictionary for Pages 5.1 is Export, and Word is one of the available formats. I have no idea how well it works (and no interest in producing Word docs) but it might be possible to do this for Pages documents.
    Numbers 3.1 has just added AppleScript support, but it does not have an Export command.
    I don't have Keynote to check.

  • Using Automator and Applescript to search and move files to flash drive

    I've used applescript and automator to do simple tasks like watch folders and move files and rename files, but that is about the extent. I am wondering if it is possible to set up a automator service or app that will do several things.
    When a flash drive is plugged it, it will ask for a file to be searched for, then it will search a predetermined directory for files with the word or number in them and then it will copy the found files to the mounted flash drive.
    Any help would be greatly appriciated!
    Thanks!

    As a start, you can use launchd to run a script when a volume is mounted:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>Label</key>
              <string>com.tonyt.LaunchOnVolMount</string>
              <key>ProgramArguments</key>
              <array>
                        <string>LaunchOnVolMount.sh</string>
              </array>
              <key>QueueDirectories</key>
              <array/>
              <key>StartOnMount</key>
              <true/>
              <key>WatchPaths</key>
              <array/>
    </dict>
    </plist>
    You can then have the LaunchOnVolMount.sh script perform the tasks you need.
    You can incorporate Applescript within the Bash script with osascript:
    #!/bin/bash
    answer=$( osascript -e 'tell app "System Events" to display dialog "What file do you want to search for?" default answer "" ' )
    echo $answer
    I beleive that you can also call an Applescript from launchd

  • Is there a way to use Automator or Applescript to launch the Mac App Store and download updates automatically?

    As the subject indicates, I'm wondering if anyone knows a way to use AppleScript or Automator to launch the Mac App Store and download any available updates on a set schedule.

    I would advise against this. Updates sometimes reduce functionality or break programs.  I would never get an update with working software unless there is a specific problem you are trying to solve.
    I have read many desperate posts from people trying to go back to earlier versions for various reasons. This is easy to do with disk-based software,  but with downloaded software, going backward can be more difficult.

  • Using Automator or Applescript to switch between 32 and 64-bit modes

    I'd like to use applescript or automator to create something that would switch logic in and out of 64-bit mode (yes, I'm lazy). I've been fooling around with automator to no avail...anyone have any solutions?
    Thanks in advance.

    As a Launchbar devotee, it's pretty easy for me - to run Logic I hit command-space (to activate Launchbar) then "l" (lower case L) to select Logic and return to run it.
    If I wanted to change mode I do command-space (activate Launchbar) l (to select Logic) then command-I to do a get info, untick the box and go.
    None of this tedious open finder windows and locate the application bundle etc... I do a huge amount via Launchbar, it's about the quickest most efficient way of doing many things.
    Not sure about Applescripts, my guess is it would be quite clunky and slower than the way I do it...

  • Automator or Applescript using png files with alpha channel

    I have hundred of png files with alpha channel.
    I want to suppress alpha channel.
    How can i do it using Automator or Applescript ?
    Thank you very much.

    You can use the free command line image processing tool ImageMagick in your Applescripts or Automator workflows, as well as from a Terminal shell.
    You can download ImageMagick from http://www.imagemagick.org, but Cactuslab has simplified installation by putting together an installer package. It’s available at  http://cactuslab.com/imagemagick/. Download the package and double-click on it. Follow the instructions to install. It will install ImageMagick into /opt/ImageMagick and add it to your $PATH by creating a file in /etc/paths.d/. Restart your computer for the changes to take effect.
    The two ImageMagick commands we’re concerned with are “convert” and “mogrify”. Convert is more efficient for multiple and piped operations on the same image file, and mogrify is more efficient for batch processing. Generally speaking, convert will output a file separate from the input file. Unless a path is specified, mogrify will overwrite the input file with the output file. An important distinction.
    You can perform various operations on the alpha channel using arguments after either the convert or mogrify command. Two of the available arguments are:
    -alpha off - Disables the image's transparency channel. Does not delete or change the existing data, just turns off the use of that data.
    -alpha remove - Composite the image over the background color.
    Also of use are the -flatten and -background options:
    -flatten - overlay all the image layers into a final image and may be used to underlay an opaque color to remove transparency from an image.
    -background - sets the background color.
    Start off using the convert command with a single image to see the effect and adjust to your liking. Once you’ve achieved the desired outcome, then use the mogrify command to batch process the chosen images.
    Before getting into how to use Automator or Applescript in your workflow, use Terminal and the command line to see the effect on a single image. Copy one image to your ~/Desktop. In Terminal change the directory to ~/Desktop by typing the following command and pressing the Enter key:
    cd ~/Desktop
    Then choose the option you are looking for, -alpha remove for instance, type the following command and press the Enter key:
    convert input-photo.png -alpha remove output-photo.png
    You can check the alpha channel (transparency) and background in the Preview app, go View > Show Image Background from the menu bar.
    Once you’re ready to batch proces, place all the photos you want to convert with the same command into one folder. Copy the folder to your ~/Desktop. Let’s assume you’ve labeled the folder “InPhotos”. It’s prudent to manipulate copies in case something goes amiss. In that event you can copy the folder with the originals again and start over. Create a new empty folder on your ~/Desktop and call it “OutPhotos”. Let’s also assume your home directory is called “Me”. The following command will process the photos from the InPhotos folder and put them in the OutPhotos folder:
    mogrify -alpha remove -path /Users/me/Desktop/OutPhotos/ /Users/me/Desktop/InPhotos/*png
    According to Apple Technical Note TN2065:
    "when you use just a command name instead of a complete path, the shell uses a list of directories (known as your PATH) to try and find the complete path to the command. For security and portability reasons, do shell script ignores the configuration files that an interactive shell would read"
    So, you need to use the full path to to ImageMagick commands, unlike in the shell where you can just use the command name.
    To batch process using Automator, use the “Run Shell Script” action (note: retain the single space at the beginning of the last line):
    /opt/ImageMagick/bin/mogrify \
    -alpha remove \
    -path /Users/Me/Desktop/OutPhotos/ \
    /Users/Me/Desktop/InPhotos/*png
    To batch process using Script Editor (Applescript), use the “do shell script” command:
    do shell script "/opt/ImageMagick/bin/mogrify -alpha remove -path /Users/pd/Desktop/OutPhotos/ /Users/pd/Desktop/InPhotos/*png"
    Further info on ImageMagick:
    http://www.imagemagick.org/script/command-line-options.php#alpha
    http://www.imagemagick.org/Usage/masking/#remove
    http://www.imagemagick.org/index.php
    http://www.imagemagick.org/script/command-line-tools.php
    http://www.imagemagick.org/script/command-line-options.php
    Examples:
    The original PNG image:
    -alpha off:
    -alpha remove:
    -background black -flatten:
    -background blue -flatten:
    -channel alpha -evaluate Divide 2:
    -channel alpha -evaluate Divide 2 -background black -flatten:

  • I am trying to use automator to open a safari popup window that will automatically log me into whatever account and I attempted to type up an applescript that utilized the "System Events" function with no avail, any ideas?

    I am trying to use automator to open a safari popup window that will automatically log me into whatever account and I attempted to type up an applescript that utilized the "System Events" function with no avail, any ideas?

    Hi
    In iMovie'11 (version 9.0.x)
    on top menu row - Apple/iMovie/File/Edit/Cut (Can vary dep. on language - in Swedish Apple/iMovie/Arkiv/Redigera/Klipp . . . )
    down Cut menu - Slow playback/Raspid Playback/Re-play in Slow Motion and onvards
    Here one can select the Pre-Set speeds
    Are you familiar with getting 'inspector' to run?
    No - but I guess that Double Click on clip/sequense or ctrl-Click on it might open it.
    Yours Bengt W

  • Using automator/applescript to do terminal commands/ssh

    hi,
    pardon my extreme novice question here, but i was looking for quick & easy ways to create a small applet to basically run a script on a web server to remotely check & update it's IP address with its web host, and also serve internet services to a wifi access point.
    here's the basic stuff we usually do in terminal —
    my-Computer:~ admin-user$ ssh admin@+{web server IP, ex.: 0.0.0.0}+
    +{we then have to wait for it to connect and ask for a password}+
    Password: {our input for password}
    Last login: Sat Jun 14 15:04:58 2008 from 0.0.0.10
    Welcome to Darwin! +{so we are now connected}+
    www:~ webserver-admin$ sudo /var/root/IP_update.sh
    +{there is then a long output as that script runs and updates the IP with the web host}+
    www:~ webserver-admin$ sudo route add -net 0.0.0.0/24 0.0.0.3 +{serve up internet services to a wifi access point, returns output that it was done, failed or already connected}+
    www:~ webserver-admin$ sudo /opt/local/sbin/lighttpd -f /opt/local/etc/lighttpd/lighttpd.conf & +{starts up our web server, returns that it was started or already on because port 80 is in use}+
    so that's what i want it to do. i thought using automator and the *run shell script* option in it would work, but i can't even get past the first ssh command without an error. i have it set to use /bin/sh, and have tried it with *pass input* setting set either way, *to stdin* or as arguments, but in either case, just on this first line alone, i get the following error —
    Run shell script failed
    Pseudo-terminal will not be allocated because stdin in not a terminal.
    does anyone know why this is happening? how do i get around this and proceed on with my script using automator?
    also, if anyone could please give tips about how to use the "pause" to have it wait for prompts over the network (like the "Password:" prompt coming back after an indeterminate number of seconds) and which automator command might be used to pop up a dialogue for user input (like asking for the password), it would be much appreciated. thanx.

    You'd want the *do shell script* command in AppleScript for this
    http://developer.apple.com/technotes/tn2002/tn2065.html
    however you're not going to be able to use it as you would tools such as Expect which allow you to wait and provide additional input on stdin. If all you're doing is updating an IP address why not simplify the entire mess with BIND's dynamic updates?

  • Using Automator/Applescript with Keynote?

    For a series of presentations I'm creating, on practically every slide, I have to delete a picture, then paste the replacement on the slide, resize that item, and reposition it on the slide (at the same location).
    This seemed like a perfect use for Automator, and I recorded my steps in Automator, but I ran into a couple of questions after that.
    1) When I'm in Keynote, I don't see a command to run a script.
    2) I'm looking at the automation that was created, and the workflow includes "Type 600 px into the text field." But I'm concerned that I don't see anywhere in the workflow that specifies what property is being edited at that point.
    Chuck

    Thanks chuck,
    I never thought to use Automator before but may give it a try now.
    I'm pretty new to AS so don't quote me, I know some apps have a File Menu command to run scripts but in general *** are run from the script menu on RHS of Menubar, perhaps you need to activate a pref for that I can'r remeber how I got mine there. Applescripts can be run with Keynote but have limited use. It seems to me there is no property dictionary for Keynote items.
    But i did find this snippet in somebody's applescript suggesting interaction via keyboard shortcuts is possible. Also controlling the slideshow is definitely support by the application dictionary.
    tell application “Keynote“
      activate
    end tell
    tell application “System Events“
      tell process “Keynote“
        keystroke “v“ using {command down}
      end tell
    end tell
    http://piyocast.com/as/archives/537

  • Using Automator to create a text box of certain size

    I'm very new to using automator... in fact I haven't used it at all, but I am wondering if I can use it to create a text box of the same size each type to type in within preview (a PDF document).  Basically I want to click or push something and have a text box be generated that is the same size each time.
    Thanks!

    1. In the Finder actions you will need:
    - Get Specified Finder Items, and point it towards the folder that will contain the movie.
    - Get Folder Contents - to get what's inside the folder.
    - Filter Finder Items - set to filter by 'Name Extension' 'Is equal to' 'mov' and make sure all your video files have the right extension...
    - Open Finder Items - in QT Player - note that this might cause problems if there are multiple files in the folder...
    Then from the QT Player actions:
    - Play Movies.
    2. Save As... Application, then after saving, drag the app into the login items for the user account.
    3. That's going to need some AppleScript, but this thread should get you started:
    http://discussions.apple.com/thread.jspa?threadID=455825&tstart=0
    Ian

  • How to resize and change the resolution of a batch of photos using Automator

    I searched for a long time tonight looking for the answer to this (seemingly) simple question:
    How do I use Automator to scale and change the resolution of a batch of images?
    It was not so simple.
    Links to this question:
    https://discussions.apple.com/message/12341246#12341246
    https://discussions.apple.com/message/12342026#12342026
    https://discussions.apple.com/message/5785047#5785047
    https://discussions.apple.com/message/1173358#1173358
    https://discussions.apple.com/message/5641853#5641853
    https://discussions.apple.com/message/3207516#3207516
    These are just the links on this site - I found them all over the place at MacRumors, Apple Tips, Mac Help, etc.
    You can actually manage this in Automator.
    Here are the steps that worked for me:
    Create an Automator APPLICATION - not a workflow (this is due to the way that I'm batch converting images - workflows might be ok for some cases)
    Step 1 is Copy Finder Items
    My flow inserts an SD card, opens the DCIM folder that my Nikon creates, selecting the images that I click (command + click to multi-select) and once I have the photos highlighted, I drag them onto this Automator App we're creating.
    <==  You'll have this guy soon!
    As a result - I want to copy the originals to my computer as step 1.  I don't touch the originals on the SD card (and cards are cheap so I tend to leave them on the cards as well)
    Step 2 is the Scale Images action - you can search the library for this and find it quickly.  For my part, I found that scaling images to about 38.8 percent of their size on the SD card is good for uploading to a blog.  Change this value to whatever you wish.
    Step 3 is Run Shell Script - and here is where we marry the brilliance found at this link with our script.If you have a hard time reading the text in the image, it is as follows:
    #bin/bash
    for f in "$@"
    do
         /usr/bin/sips -s dpiHeight 72.0 -s dpiWidth 72.0 $f
    done
    Save this application (I named mine "Format Photos")
    Place the application inside the target folder where you want the images to end up.  I do this because when I have the SD card window open, I can also open my "Photos" window and see my App sitting there.  I select my images as I mentioned and drag them on top of this app.  The app copies the originals and the conversions into the folder.
    NOTES: When you open a converted pic in Preview, you will see Resolution = 300 dpi if you go to Tools --> Adjust Size...  This reading is explained by another brilliant discussion as sips only touches the JFIF properties inside the file's MetaData.  However, if you look at the bottom of the Adjust Size... window, you'll see the image size is probably around 500 kb (give or take depending on the original).  My goal was to get the images down from the 3.0 MB I shoot at to around 500 kb.  Therefore even though the MetaData still thinks that it is 300 DPI according to Preview, it has been changed to 72 (open it in some other applications mentioned at the links and you'll find different readings - it all depends on what the application reads from the Meta).
    This does not rename the files, so you'll get DSC_1000.jpg and DSC_1000 copy.jpg in all likelihood.  If that annoys you, add a step into the Automator Application that renames the file after the "Run Shell Script" action has run, and you can have each file renamed according to some convention that you like.
    This took a heck of a lot longer than I expected - so I decided to put in the effort to share this with the community and save others the hassle. 

    PPI is pixels per inch of the image.  It is difficult to increase resolution as you are trying to add data that is not there.
    But for printing purposes what you want is dpi or dots per inch.
    The image processor either accessed from Bridge (tools/photoshp) or PS is a good way to change a batch of images.

Maybe you are looking for