Keynote and Apple Script

I need a script, runnable on a Mac acting as a server, that can do the following without human interaction.
1. Open a keynote file - we can open keynote file manually
Automative should finish following tasks ..
2. From the "Share" menu within KeyNote, select "Export..."
3. Choose "Images", keep the format as 'Jpeg' and the quality at 66%, click "Next..."
4. Create a "New Folder" (may be we can create similar file name like 1.key ----> folder name 1/but this should be done by automatic )
5. Click "Export"
6. close keynote
I need this to be able to run from the command line somehow. I'm not sure the best way to do this: applescript? or work flow ?
thanks fin advance

The following script seems to work flawlessly under Mac OS X 10.6.5 with version 5.0.4 (633) of Keynote ’09, using the +default preferences+ of the application.
Since the script uses [GUI Scripting|http://www.macosxautomation.com/applescript/uiscripting/index.html], you should first enable the Accessibility Frameworks by clicking the checkbox labeled "Enable access for assistive devices" in the Universal Access System Preference pane.
To run the script from the command line, just type something like the following in the Terminal window:
*~ username$ osascript /Users/username/Desktop/Keynote\ script.scpt*
if the compiled script, for instance, is named "Keynote script.scpt" and located on the Desktop.
(You migh need to adjust the delays if necessary.)
--Change the following two lines to fit your needs:
*set theKeynoteFile to POSIX file "/Users/pierre/Desktop/My Keynote Slideshow.key" as alias*
*set theDestinationFolder to POSIX file "/Users/pierre/Pictures/" as alias*
--Create a new folder (temporarily located on the desktop) where to export the slides:
*tell application "Finder"*
*   set theFolderName to text 1 through -5 of (get the name of theKeynoteFile)*
*   make new folder at desktop with properties {name:theFolderName}*
*   set theExportFolder to result as alias*
*end tell*
*tell application "Keynote"*
   activate
*   set theSlideshow to open theKeynoteFile*
*   repeat until theSlideshow exists*
*      delay 1*
*   end repeat*
*   delay 1*
*   if playing then*
*      stop slideshow*
*      delay 1*
*   end if*
*   tell application "System Events"*
*      tell process "Keynote"*
*         click menu item "Export…" of menu 1 of menu bar item "Share" of menu bar 1*
*         delay 0.25*
*         tell sheet 1 of window (displayed name of theKeynoteFile)*
*            click button "Images" of tool bar 1*
*            delay 0.25*
*            click pop up button 1*
*            click menu item "JPEG (variable quality)" of menu 1 of pop up button 1*
*            delay 0.25*
*            set value of text field "Quality:" of group 1 to "66%"*
*            keystroke tab*
*            delay 0.25*
*            keystroke return* -- click button "Next…"
*            delay 0.25*
*            if value of checkbox 1 is 0 then click checkbox 1*
*            delay 0.25*
*            click radio button 2 of radio group 1 of group 1*
*            keystroke "d" using command down* -- desktop
*            tell outline 1 of scroll area 2 of splitter group 1 of group 1*
*               select row 1 whose value of static text 1 is theFolderName*
*            end tell*
*            keystroke return* -- click button "Export"
*         end tell*
*         delay 1*
*         click button "Export" of sheet 1 of window 1*
*      end tell*
*   end tell*
   quit
*end tell*
*tell application "Finder" to move theExportFolder to theDestinationFolder with replacing*
Please let me know if the script doesn't work as expected.

Similar Messages

  • KeyNotes and Apple script / scripting Bridge

    Hi
    Sorry I am a recently started development in Mac OS, so may be this question is very simple for you guys
    actually I am looking to manage Keynote application automatically from Mac Server application, I know apple script is available for lot of functionalities available in keynote but i want that all these things happend without showing anything on GUI , like i want to do all the automation on background without effecting the running GUI of keynote
    if anybody can have idea how to do it in Apple script or using ScriptingBridge, I will really appriciate your help and support

    depending on what you want to do, this may or may not be possible (most likely not).  Applescript works by scripting other applications: some applications are set up do do background tasks, some applications are duplicated by osax or unix utilities that operate invisibly, but most often applescript has to open a document in the application and work on it through the application. 
    scripting bridge is for cocoa developers: it allows cocoa apps to script other apps.  it's not really useful for you unless you want to develop specialized software.
    more details would be helpful.

  • Airport and Apple Script - on and off script

    I've had this problem for a while, trying to turn the airport card in a computer on and off using and apple script. i need it to automatically turn on or off depending on which account if logging into the computer.
    I did find that a solution can be found by writing an apple script to turn airport on and off. but my scripting skills aren't good and haven't worked thus far.
    So now i'm asking everyone: Can anyone write a script to turn the airport on or off? I bet you can't. (there's some motivation for you)
    I think it's my last resort, turning to other apple user and requesting help, because i have not been able to find another solution or a prewritten script (surprisingly)
    Thanks very much for your help!
    "i'll gladly pay you tuesday for a an apple script today."
    thanks

    I haven't used these tools so I don't know for sure, but doesn't Tiger's parental controls (in the Accounts preference pane) allow you to enable/disable network access by account? Would that work to solve your problem?
    EDIT: OK, by starting a new thread I guess you got the same response that I posted for your previous thread. For those interested, this is a continuation of the thread kevin macky, "Account with and without airport internet access", 08:07am Oct 11, 2005 CDT.
    If you are interested in trying to automate this, I suggest that you post your question in these areas:
    Mac OS X > Mac OS X Technologies > AppleScript
    Mac OS X > Mac OS X v10.4 Tiger > Automator

  • Starting applications from a keynote via Apple Script?

    Is there any way to start an application from a keynote via Apple Script?

    Welcome to the forums!
    Keynote does not support the use of AppleScript in that fashion.

  • How do I install and apple script in mail

    I am using  dreamhost as my ISP. I am  getting killed with spam and the have a  script. I found out how to add  the script via the rules function, but,  how do you store the script in  the location you need to retreive it  from. there I can't find info. Can  someone give me steps please? Do you  make a text file, etc?

    Select Mail Help from Mail's Help menu. Search for "install apple script."
    Use scripts as rule actions
    You can attach a script to a Mail rule. For example, you could have an incoming message trigger a script that copies information from the message and pastes it into a database that works with AppleScript.
    Open Mail
    Choose Mail > Preferences, then click Rules.
    Add a rule or select an existing rule to edit.
    Choose Run AppleScript from the “Perform the following actions” pop-up menu.
    Choose a script from the pop-up menu of scripts that are located in ~/Library/Application Scripts/com.apple.mail. Or choose “Open in Finder” to open the folder so you can copy a script into it.If you later move or rename the script, your rule will not work.
    Click OK to save the rule.
    If you used scripts in Mail rules in OS X Lion or earlier, then the first time you open Mail in OS X Mountain Lion or later, your scripts are moved to ~/Library/Application Scripts/com.apple.mail, and your rules are updated with the new location. To show your home Library folder, hold down the Option key, then in Finder choose Go > Library.
    If you use iCloud Documents & Data, your rules are available on your other Mac computers (with OS X 10.8 or later) that have iCloud Documents & Data turned on. Scripts attached to rules aren’t available.

  • Keynote and apple TV

    I really would like to use iPad Keynote with Apple TV. This would be a big money saver for our office during presentations but we cannot see how to do it right now. Basically it would mean we would buy apple TV modules for the office and then we would be free to do presentations in any of our rooms using wireless.
    If this can be done can anyone explain how?
    Does apple have plans to include this ability in future updates?

    To the best of my knowledge, Keynote does not support Airplay, so this would not be possible though an Apple tV. You can, however, connect the iPad to a screen directly either via HDMI (or DVI with an HDMI to DVI adapter) or VGA. Keynote does support video out.
    Whether or not Apple has plans to add Airplay support to Keynote, no one here will know since we're all just fellow users.
    Regards.

  • Network location and apple script

    Hi,
    I have a strange problem... When I try to use this AppleScript to change network location in Leopard, nothing happens:
    tell application "System Events"
    tell network preferences
    get properties
    --> returns: {current location:location id "51BD3FB7-50D1-4859-9649-9138E7FF1ECA" of network preferences, class:network preferences object}
    get the name of every location
    --> returns: {"Automatic", "Sprint Card"}
    set current location to location "Automatic"
    end tell
    end tell
    This is copy-pasted from <http://www.apple.com/applescript/features/system-prefs.html>. I have 3 locations set: home, office and Automatic. I'm currently using home, and this script just silently fails to set the location to Automatic... Any thoughts/hints?

    That works, thanks!
    I'm still wondering why "pure" AppleScript solution proposed by Apple is not working?

  • Keynote and Apple Aluminum Remote

    I have used Keynote for a long time now and never had problems using it with a remote control.
    I updated to Mountain Lion recently and **** broke loose! I cannot get Keynote to work with a remote if I am showing my presentation on a secondary display (an LCD TV connected to my Macbook Pro via an HDMI cable). I did manage to reset the SMC (System Management Controller) but it solved my problem only temporarily. I know the problem is not with the remote because when I use it with Keynote and I am not using a secondary display, it works perfectly. BTW, iPhone and iPod touch remotes are not enabled.
    Anyone knows how to solve this?
    TIA

    An update:
    The remote works well with Quicktime. I had to play an mp3 file and the remote apparently works well with you. Keynote seems to be the culprit...

  • Need help writing and Apple Script

    I've never written an apple script before so I need the entire tutorial for dummies. Basically, I am annoyed with the fact that Microsoft Word 08 keeps opening a new document at 100% zoom when I want it to open at "page width." How do I write a script for that?

    You don't need an Applescript. Open the New Document template, resize as you like then save the template.
    To learn Applescript start here. You will also find support at the Applescript site for developers. Your local book store or Amazon.com have dozens of books on Applescript programming.
    Here's the main site for obtaining Applescripts.

  • Word save as format and apple script

    Hi,
    I want to open my doc file and save as docx file. What is the proper file format to do this.
    I have use the following code:
    set mydoc to "/Users/administrator/Desktop/Sample.doc"
    tell application "Microsoft Word"
      activate
      open mydoc
      save as active document file name "Sample_new.docx" file format format document
      close active document
    end tell
    But it saving the file in Compatibility Mode. So i want to know whether it saving the file docx or not.

    It's much easier to use the command line textutil utility.  in applescript you'd use:
    do shell script "textutil -convert docx /path/to/wordfile.doc"

  • Mail and apple scripts

    Anyone into scripting more than me..? I need some help !
    I wish to set up an automated system where by if a 'hot' folder upon my desktop receives a newly created jpeg file, an email is then generated with an attatchment of the jpeg and sent out to a designated group of emails
    Is this possible..?
    Cheers
    please email me or post here
    Matt
    www.matthewashton.com
    Powerbook G4 and G5 and MacBook Pro   Mac OS X (10.4.6)  

    Matt,
    Have you tried to do this with Automator yet?

  • Keynote and Apple 30" Display

    What is the best (optimum) size to make a Keynote presentation for displaying on a 30" Apple Cinema Display? The presentation will loop. Should I export the slide show to Quicktime or just use Keynote?

    As in all cases, you'll get best results if the slide size is whatever the "native" resolution of the monitor is. In the case of the 30" Cinema Display, that appears to be 2560 x 1600.
    If the presentation works fine in Keynote, I would not export it to Quicktime, as Keynote can loop a presentation just fine.

  • Install and uninstall of dmg file using Apple script in Mac 10.6 and higher version.

    Hi ,
    Could anyone please help me to write a Apple script to Install dmg file and do clean uninstall in Mac 10.6.8 and higher version.
    My requirement is:
    When i run script : it has to install the dmg file which is located inside one desktop folder say 'New Folder'
    I need to do clean unistall when i run the script: i need to delete the folder in ~/Library- locate folder say  'CPSPCSHOWSERVER'' move to trash and from Terminal type in command "rm -r ~/.CPS' to completely delte this folder.
    Really appreciated all ur help!!
    Thanks,
    KT.

    http://macfidelity.de/2008/08/30/how-to-mount-a-dmg-from-terminal-in-mac-os-x/in dex.html
    http://osxdaily.com/2011/12/17/mount-a-dmg-from-the-command-line-in-mac-os-x/
    http://hints.macworld.com/article.php?story=20030614230204397
    http://www.commandlinefu.com/commands/view/2031/install-an-mpkg-from-the-command -line-on-osx

  • My ipad air was bought and activated AFTER September 1st and I downloaded pages, keynote and numbers. I then changed my Apple ID as the password no longer worked, these apps were also deleted I order to be updated. Now I cannot get the free version. Help?

    My ipad air was bought and activated AFTER September 1st (activated December 25th) and I downloaded pages, keynote and numbers. I then changed my Apple ID as the password no longer worked, These apps had to be deleted as I needed to update them. Now I cannot get the free version on my ipad. I have searched the internet to see if there is a solution, and I found a few but unfortunately none have worked. I desperately need these apps as my iPad is used for school. Is this an issue I should take up with the apple support centre or something? Please help! Thanks

    How to get all the iWork apps, iPhoto, and iMovie for free on an eligible iPhone or iPad
    http://www.imore.com/how-get-all-iwork-apps-iphoto-and-imovie-free-eligible-ipho ne-or-ipad
     Cheers, Tom

  • Help creating apple script to create folder and set access levels

    I'm trying to create folders in FileMaker Pro using apple script and need some help in setting the access level for the folders.  I want to set both Staff and everyone to Read and Write access.   Secondly I would like to have a function key set on the desktop to create new folders and set that same access level.  The default access is Read and I can not find a way to change that.
    Thanks

    I'm trying to create folders in FileMaker Pro using apple script and need some help in setting the access level for the folders.  I want to set both Staff and everyone to Read and Write access.   Secondly I would like to have a function key set on the desktop to create new folders and set that same access level.  The default access is Read and I can not find a way to change that.
    Thanks

Maybe you are looking for