2 Replies Latest reply: Jun 16, 2012 11:30 AM by Myrm Hiles
Myrm Hiles Level 1 (25 points)



Firstly, forgive me if this is in the wrong place.


I have created a simple apple script (my vary first one) in which I wanted the script, when run, to open a random image from a folder that had images within it.  I did it using this code:


tell application "Finder"

  (* get a random image file from a desktop folder *)

          set randomImage to some file of folder "Pictures"

  open randomImage


end tell


That worked well and good when the folder containing the images was on the desktop.  However, the folder I really want to use is on a USB stick.  How can I tell the script that the folder I want it to run with is on the USB Stick?


I know I could easily copy the folder from the stick to the desktop, but I'd rather keep the folder on the stick.


Vary many thanks.

Mac OS X (10.7.4), 8GB RAM