Starting a Slideshow Applescript help

I am trying to make an Applescript to launch a slideshow from the finder, not an iPhoto slideshow, but the one you get by clicking the Tools button and selecting slideshow. It is much easier to choose which photos I want to save my computer by using that, but it is a pain to have to select all the photos, and then click multiple buttons to view it.
So I set out to create a script to select all the files in the folder, and start a slideshow. I am very close. I can click that button, but don't know how to script the menu it displays when clicking the button. Much help would be appreciated.
Here is my script so far:
tell application "Finder"
activate
tell application "System Events"
tell process "Finder"
tell menu bar 1
tell menu bar item "Edit"
tell menu "Edit"
click menu item "Select All"
end tell
end tell
end tell
end tell
end tell
end tell
tell application "System Events"
tell process "Finder"
tell window 1
tell tool bar 1
tell group 2
tell menu button 1
click
end tell
end tell
end tell
end tell
end tell
end tell
13" Macbook Mac OS X (10.4.9) 2 GHZ Core 2 Duo, 2 GB RAM, 80 GB HD

I assume you're after the 'Quick Look' option, right?
If so, there's a far more direct way of doing what you want. In general, avoid using UI scripting (the whole 'tell application "System Events" stuff) as much as possible. You can't do it all via direct scripting, but you can simplify your script a lot:
<pre class=command>tell application "Finder"
activate
select every file of window 1
tell application "System Events"
tell process "Finder"
keystroke "y" using {command down}
end tell
end tell
end tell</pre>
In this case I'm using the Finder's direct commands to select all the files. This is much better than trying to drive the menu bar (what happens to your script, for example, if you're running on a non-English version of the OS that doesn't have a 'Select All' item in the 'Edit' menu since those words are translated to some other language.
Unfortunately I can't see a way to invoke the slideshow directly, but I'm using the command-key equivalent of Quick Look. This is also preferable since your script would fail if the toolbar wasn't visible in the current window, and using keystrokes wouldn't have any negative effects if the menu item wasn't available for some reason.
The other advantage of using direct scripting is that you can get more creative/precise in what you want to do. For example, selecting all the items in a folder might not be appropriate, especially if there were mixed media files (word processor documents, spreadsheets, photos, etc.) or folders.
By driving the Finder directly you can do things like:
<pre class=command>tell application "Finder"
activate
select (every file of window 1 whose kind is "JPEG Image")
end tell</pre>
This makes sure you only select JPEG images, leaving everything else deselected, which is hard to do via the menus.

Similar Messages

  • Applescript help - keystroke part does not work

    Hi guys, I'm new to Applescript and would like some assistance. I have an application called iVPN that I would like to start with some applescript code - just one problem in that it requires the admin password at startup.
    I tried the following, but once the dialogue box appears to enter the password, nothing happens. It seems to stop just before the "delay 10" line. I've also tried it with just the keystroke line, but nothing happens (no password appears in the dialogue box that pops up).
    Any help greatly appreciated, Thanks!.
    tell application "iVPN" to open
    tell application "System Events"
    delay 10
    key code 48 using {command down}
    keystroke "password here"
    key code 36
    end tell

    I had you download the wrong file.
    The new name is XTool-2.0.dmg.tgz Notice the missing src.
    I simplified the example applescript file. You need to write your applescript file as needed.
    The basic plan for you is to move the mouse to the button then click the button.
    --Move mouse to input field.
    move mouse {100, 10} 
    click mouse
    --fill in the data.
    --move mouse & click button
    move mouse {120, 10} 
    click mouse
    Robert
       First, there is the XTools scripting addition, which will give AppleScript the ability to move the mouse. 
       Dowload from:
          http://www.lestang.org/osax/XTool/
       click on:
          XTool-2.0.dmg.tgz 
       Installation :
       Drag XTool.osax from insite the image to one of the following locations (create the directory if it does not exist) :
       a : ~/Library/ScriptingAdditions/
       b : /Library/ScriptingAdditions/
       c : /System/Library/ScriptingAdditions/
       I have it in directory /System/Library/ScriptingAdditions/ 
       My other two directories do not exit: ~/Library/ScriptingAdditions/ & 
          /Library/ScriptingAdditions/
       see download file XTool ReadMe.rtf for documentation
    log "  --- Starting on " & ((current date) as string) & " --- "
    set {x, y} to position of the mouse
    display dialog "mouse at " & x & " " & y giving up after 3
    display dialog "Move mouse to where you want to find coordinates, you have five seconds." giving up after 5
    set {x, y} to position of the mouse
    beep
    display dialog "New mouse position at " & x & " " & y giving up after 5
    -- Go after time message
    move mouse {10, 10}
    delay 5
    -- click mouse
    -- center mouse
    -- find the size of the display with a unix command
    do shell script "/usr/sbin/system_profiler SPDisplaysDataType | grep 'Resolution'" -- get info
    tell the result to set {DisplayWidth, DisplayHeight} to {word 2, word 4} -- get resolution
    move mouse {DisplayWidth div 2, DisplayHeight div 2} -- center mouse
    Message was edited by: rccharles

  • Itunes wont open and when re-installed received this msg: Service Apple mob device failed to start.  You have insufficent privileges to start system svc.  Help?

    Itunes wont open and when re-installed received this msg: Service Apple mob device failed to start.  You have insufficent privileges to start system svc.  Help?

    Download Itunes from Apple.com, not from within Itunes.
    Redo the install, following the below procedure.   However, when you re-install Itunes,  right click and run the install as administrator.   For Win 7, you have to hold down the cntrl and shift keys when you right click and then "run as administrator" will be an option.
    Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features (Vista, Win 7 & later)
    Remove all of these items in the following order:
    iTunes
    Apple Software Update
    Apple Mobile Device Support (if this won't uninstall move on to the next item)
    Bonjour
    Apple Application Support
    Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
    The uninstall and reinstall process will preserve your iTunes library and settings, but ideally you would back up the library and your other important personal documents and data on a regular basis. See this user tip for a suggested technique.
    Please note:
    Some users may need to follow all the steps in whichever of the following support documents applies to their system. These include some additional manual file and folder deletions not mentioned above.
    HT1925: Removing and Reinstalling iTunes for Windows XP
    HT1923: Removing and reinstalling iTunes

  • Premiere Pro crashes when i start it up. Help please :-)

    Premiere Pro crashes when i start it up. Help please :-)

    Go to Adobe Premiere Pro CC error on start and answer all the questions I posted in reply #1

  • HT204302 i get a message when I plug in my ipod to my laptop saying "cannot use this ipod because apple mobile device is not started" can any one help me with this...I have never had this happen before

    Hello anyone
    I get a message when i plug in my ipod touch saying "cannot use this ipod because apple mobile service is not started" can anyone please help me with this problem...I had this message once before but I forgot how to correct it

    From the More Like This section on the right:
    I get error message when I plug in iPhone 4s saying "This iPhone cannot be used because the Apple Mobile Device service is not started"
    can't get my ipod to connect to tunes error message "cannot be used because the apple mobile device service is not started"  fixes? Using Win XP
    im trying to connect my ipod to itunes and its saying it cannot connect because the "Apple Mobile Device is not started" help
    Or see: iPhone, iPad, iPod touch: How to restart the Apple Mobile Device Service (AMDS) on Windows

  • HT1349 I'm trying to re-install I-Tunes on my Windows 7 computer.  I get the following error message: Service "Apple Mobile Device" failed to start.  Verify that you have sufficient privileges to start system services.  HELP?

    I'm trying to re-install I-Tunes on my Windows 7 computer.  I get the following error message: Service "Apple Mobile Device" failed to start.  Verify that you have sufficient privileges to start system services.  HELP?

    Did you try to update iTunes through "Apple Software Update"?
    Uninstall everything {iTunes, Apple Software Update, Apple Mobile Device Support, Bonjour , Apple Application Support (iTunes 9 or later)}
    http://support.apple.com/kb/ht1923
    then reinstall itunes. (Download it from Apple's site.)

  • HT1386 Sync session failed to start message. No help there...

    Can't sync iPad because it "failed to start".  Not a helpful message or direction on what to do about it? Cords hooked up, wifi enabled, everything seems to be ok, but it fails to start. Any ideas?

    Try quitting iTunes, restart your computer, reset your iDevice and then try to sync again.
    Reset the iDevice by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the device start up.

  • Why can not I install iTunes on Win 7 installation appears every time the next sunrise; service, apple mobile device, failed to start verify that you have sufficient privileges to start system services  Please help me

    Why can not I install iTunes on Win 7 installation appears every time the next sunrise;
    service, apple mobile device,
    failed to start verify that you have sufficient privileges
    to start system services
    Please help me

    The most complete instructions for resolving the issues with the new iTunes is in the user tip: https://discussions.apple.com/docs/DOC-6562

  • When attempting to reinstall iTunes, I get the following message "Service (Apple Mobile Device) failed to start. Verify that you have sufficient privileges to start system services" Any help appreciated

    When attempting to reinstall iTunes, I get the following message "Service (Apple Mobile Device) failed to start. Verify that you have sufficient privileges to start system services" Any help appreciated

    Hi emelville,
    Thanks for using Apple Support Communities.  You may need to restart the Apple Mobile Device Service.  This article has instructions that may help:
    How to restart the Apple Mobile Device Service (AMDS) on Windows
    http://support.apple.com/kb/ts1567
    If that doesn't resolve the issue, I would recommend trying a thorough uninstall and reinstall of iTunes as described here:
    Issues installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/ht1926
    Cheers,
    - Ari

  • I had an error that said I need to reinstall Itunes. I uninstalled and attempted to reinstall, but now I'm getting a pop up that says Service Apple mobile device failed to start. verify that you have sufficient privledges to start system services. Help!?!

    I had an error that said I need to reinstall Itunes.  I uninstalled and attempted to reinstall and got a pop up "Serivce Apple Mobile Device failed to start. verify that you have sufficient privledges to start system services. Help!?!?

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • How do i deactivate the auto updation on my iphone 4,i want to use only watsapp but when i am turning on my celleular data all apps starts updating theirself,please help me

    how do i deactivate the auto updation on my iphone 4,i want to use only watsapp but when i am turning on my celleular data all apps starts updating theirself,please help me.I am not using any internet pack other than watsapp.

    iPhone do not do automatic update. You have to manually trigger the updates.
    If your Settings > iTunes & App Stores > Automatic Downloads > Music, Apps, Books are ON then when you purchase any new content/item with any devices/computer iTunes, it will automatically download. Switch it OFF if you do not want that to happen.

  • Flash web gallery - style.xml start with slideshow in play?

    When creating a web gallery with Lightroom, using a default flash template, a style.xml sheet is created. Does anyone know the line of code in that style.xml that sets the gallery to load with the slideshow in play mode?
    thanks,
    Donnie

    Please excuse the bump...
    Anyone with a LR flash gallery that starts with slideshow in play mode?
    Can it even be set to do this?
    The only code in the style.xml that looks like it might be realted is line 12 <playOptions playMode="pause"/>, changing that to "play" does nothing.
    Thanks,
    Donnie

  • We are unable to start your subscription  plz help me ladies and gentlemen PLZ HELP ME!!!

    i just need help because every time i type in my serial number it just says unable to start your subscription plz help me people

    -LogiKzzz we will not able to solve this issue for you in a public setting as we will require personal information to resolve the issue.  For the best assistance, I recommend our chat support at http://adobe.ly/rSZYR5.  Our chat representatives can provide a personalized experience to resolve the issue you have described.

  • When I connect the iphone does not start automatically Itunes Please help me

    when I connect the iphone does not start automatically Itunes
    Please help me
    How to solve this problem that I have

    i've had a few issues like this.
    I've found that it is an issue with items that are already on your phone.
    several troubleshoots. 
    1) uncheck everything from syncing (apps, music, tv shows, movies, podcasts, etc), try to perform a sync, it most likely will work.  Then, sync after checking each item individually (check the sync box for videos, then sync, check the sync box for podcasts, then sync, check the sync box for music, then sync, etc).  One of two things will happen, 1) you will fix the problem, or 2) you will identify exactly what part of the sync setup is the culprit.
    2) if the above doesn't work, I've found that it is likely an issue with files that are on your phone but your phone doesn't exaclty recognize (for example, I had copies of music on my phone that didn't show up in the music app, I went in on itunes and manually deleted those songs from my phone and that fixed the sync).  to do this, check the "manually manage music and videos" box at the bottom of "summary" while your phone is connected to itunes.  Then, go to the left hand pane in itunes and find your iphone device, click the drop-down arrow that shows all the categories for media on your iphone.  Go to the music category in your iphone on itunes and delete all the music that shows up.  Try to perform a sync - it likely will work.  After this, you can uncheck the manually manage music box and re-sync your phone as normal
    let me know if either works

  • Automatic start of slideshow

    How can I make my ipad start showing a slideshow automaticly when not used for a while and keep it running until I manually turn it off?

    There is no 'timeout' setting that you can use to say 'after x minutes of inactivity display photos'. So you can either go into the Photos app and start a slideshow from there, or press the sleep button twice (once to lock the iPad and then again to display the unlock screen) and then press the flower icon that appears to the right of the 'slide to unlock' (the flower won't appear if you havn't got any photos) - that will leave the iPad locked but will turn the iPad into a digital photo frame. You can set whether photos are shuffled, and how long they are displayed for, in Settings > Picture Frame (or Settings > Photos for slideshows via the Photos app)

Maybe you are looking for

  • Safari, Mail, iTunes and Skype won't open

    Hi there Apple-Support-Team, a few days ago I did an update of Safari, suggested automatically by Apple, but wasn't sure if the update was successfull (I had to leave the house). Now all applications with internet connection (Safari, Mail, iTunes, Sk

  • I bought music with my ipod and idk how to get it onto my itunes library?

    i bought music using my ipod touch and its wifi features. I then set a passcode adn i cant remember it so i plugged it into my computer. i am comfused because i know i need to restore it, but i will lose all my music that is only on my ipod and trust

  • Thunderbird Mac - command+w for close Mail & newsgroups window not working

    I use almost all keyboard shortcuts. So when I need to close the email window without quitting the program, I've *always* just hit command+w. It stopped working a few days ago. it doesn't even work if I choose "close window" in the File menu. In orde

  • Ram/Resetting problems

    A couple of days ago I bought 2x 512mb DDR 400 sticks of ram. The PC worked fine until I tried playing Battlefield Vietnam. At random times the PC would shutdown and restart by itself with no error messages. It has also happened while not playing gam

  • GPO's not getting applied

    I have created a GPO to allow offer remote assistance. but I'm failing to get it work.Please help. Only Wallpaper policy is working.GPO setting on server______________________________________________Allow Offer Remote Assitance Data collected on: 7/1