Opening a random file in Applescript is not really random

Hi all,
I'm not very experienced in Applescript, but I was trying to help a friend write a quick script that opens a random mp3 from an external harddrive (don't ask me why he's not using iTunes). The problem is, that when he plugs his hard drive in and runs the script, the songs are always opened in the same order. How can we fix this?
The script looks like this:
Tell application "Finder"
open some file of folder "Harddrive:folder:subfolder"
end tell
Any ideas?

Try using:
tell application "Finder"
open file (random number from 1 to (count files of folder "Harddrive:folder:subfolder")) of folder "Harddrive:folder:subfolder"
end tell
(56771)

Similar Messages

  • I want to edit my raw images on cs5 photoshop.  But when I go to open the .CR2 file it says  '' Could not complete your request because the file appears to be from a camera model which is not supported by the installed version of Camera Raw. Please visit

    I want to edit my raw images on cs5 photoshop.  But when I go to open the .CR2 file it says 
    '' Could not complete your request because the file appears to be from a camera model which is not supported by the installed version of Camera Raw. Please visit the Camera Raw help documentation for additional information.  '' 
    When I go to updates in photoshop help i try to update photoshop and photoshop camera raw but it then says 
    '' Updates could not be applied the error log file may help you in identifying the problem. Then, try updating again. If the problems persist, contact customer support for further assistance. 
    Photoshop Camera Raw 8.7.1(CS6) There was an error installing this update. Please quit and try again later. Error Code: U44M1I216 ''  
    I dont know how to get around this please help

    CR2 files from which Canon camera?
    Supported cameras are listed here
    Camera Raw plug-in | Supported cameras

  • HT3775 Quicktime is not opening my Mp4 files and I do not know why? Any suggestions?

    Quicktime will not open my mp4 files and I do not know why. ANy suggestions? it happened after I upgraded to IOS 6. Not sure what to do. VLC program will open them but not Quicktime. I can't get them into Itunes either. Thanks!

    Quicktime will not open my mp4 files and I do not know why. ANy suggestions? it happened after I upgraded to IOS 6. Not sure what to do. VLC program will open them but not Quicktime. I can't get them into Itunes either. Thanks!

  • After the recent update on my Ipad Mini. It crashes frequently. The latest is that during saving, it crashed. Now I can't open my project file. It says, Not a valid Adobe Photoshop Touch file. What happened?!!

    After the recent update on my Ipad Mini. It crashes frequently. The latest is that during saving, it crashed. Now I can't open my project file. It says, Not a valid Adobe Photoshop Touch file. What happened?!!

    Sufficient free storage.... tried the reboot and install... Just received an iOS update I'll install tonight and do another reboot...see what happens. Going to have to start saving double..

  • I choose Adobe Reader XI to open a GPX file. It will not open it how do I get past the screen that says it will not open it to choose something else?

    I choose Adobe Reader XI to open a GPX file. It will not open it how do I get past the screen that says it will not open it to choose something else?

    http://windows.microsoft.com/en-us/windows/change-file-open-program#1TC=windows-7
    or
    http://windows.microsoft.com/en-us/windows/change-default-programs#1TC=windows-7

  • When opening a filn in illusrtator CC I have memory plroble,.  Opening the same file in CS5 does not make problems

    When opening a filn in illusrtator CC I have memory plroble,.  Opening the same file in CS5 does not make problems.
    How can I get in contact with an adobe employee, where I can finally solve my problem with CC (with whom I can send email back and forth or who calls me)... On my PC CC does not work well... I often need to use my old CS5 version.

    You have not provided any proper system info, so nobody can even guess.
    Mylenium

  • HT1414 i have downloaded ios 5 for my itouch 5g but when i click shift and restore and open the ipsw file it sayz its not compatible

    i have downloaded ios 5 for my itouch 5g but when i click shift and restore and open the ipsw file it sayz its not compatible

    Apple does not support downgrading the iOS. If you try installing an earlier iOS you get the error message. Apple only supports installing/restoring to iOS 6.0.1 on the 4G and 5G iPods.

  • Unable to open a CS5 file in CC - does not recognize plugin - please help. Just removed old software and replaced with CC yesterday.

    I was having issues with illustrator and it was time to upgrade anyway, so I uninstalled all previous versions of Adobe and upgraded to CC. Now I'm trying to open my old files and the exact error reads, "Could not read the fiel because the plug-in could not understand this file." What plug-in do I need to download? And why wasn't this part of the package in the first place?

    Jeannie,
    The three step reinstallation may be relevant.
    But you could try to create a new document and File>Place the troublesome one to see how much may be rescued that way (remember to tick Paste remembers Layers in the Layer palette flyout/dropdown first, and to untick it afterwards).
    If it is a corrupt file, there are some more things to try, but in this case it might take too much of the little time before your deadline.
    Here is a website where you can see whether it can rescue the file, and if it can, you may pay for a subscription to have it done,
    http://www.recoverytoolbox.com/buy_illustrator.html
    and another similar website,
    http://markzware.com/adobe-software/fix-illustrator-file-unknown-error-occurred-pdf2dtp-fi le-recovery/
    As far as I remember, the former is for Win and the latter for Mac.
    Here are a few pages about struggling with it yourself:
    http://daxxter.wordpress.com/2009/04/16/how-to-recover-a-corrupted-illustrator-ai-file/
    http://helpx.adobe.com/illustrator/kb/troubleshoot-damaged-illustrator-files.html
    http://kb2.adobe.com/cps/500/cpsid_50032.html
    http://kb2.adobe.com/cps/500/cpsid_50031.html
    http://helpx.adobe.com/illustrator/kb/enable-content-recovery-mode-illustrator.html

  • JInternalFrame not opening in JAR file, but works when not in JAR

    I have a folder that contains multiple .class files. I make all the class files into one jar file with this command:
    jar cmf mainClass.txt myapplication.jar *.class
    The mainClass.txt contains the following:
    Main-Class: myapplication
    class-path: myapplication.jar
    The myapplication.class opens up a JDesktopPane inside a JFrame. It also contains a start menu, which again has elements that opens up misc JInternalFrames inside the JDesktopPane. The problem is this:
    When I run the application from a .bat file, everything works fine. However, after making the JAR Executable file, everything works except 1 JInternalFrame. Now, the code for this JInternalFrame is far too much to post, so I'll have to ask as follows;
    Are there any reason why a JInternalFrame would not work from inside a JAR Executable, but work when not in the JAR file? Especially when other JInternalFrames are working? What can make 1 JInternalFrame different from the others in this regard?

    Perhaps the problem lies somewhere else.
    Obviously if other JInternalFrames are working then there is a difference in the one missing internal frame that causes it not to show up.
    My guess is that perhaps you are missing one or two classes in your JAR that are used by that JInternalFrame and that an exception is being thrown causing it not to show.
    Double check the contents of your JAR and make sure that all the classes are present and that they are the right versions.

  • Illustrator can't open my saved file because there is not enough RAM.  Can someone help me?

    I was working all last night on artwork using Illustrator and now I cannot get it to open.  The message reads that there is not enough RAM.  This is after a long pause of waiting for illustrator to read the file.  The file is 37 MB large, so it doesn't seem that daunting for my MacBook Pro with 8 GB of RAM.  Any thoughts?  Other files open with no problem. 
    After I hit ok on the message (Not enough RAM), it seems to be trying to work on something in the Illustrator file and then repeats saying there is not enough RAM.
    Any help is greatly appreciated.

    Thanks, there was a message on my file that suggested I save it with the PDF compatibility, but I am not able to do that till I get in.  I am at the Apple store now to see if they can help me out.  It would be sad to lose all that inspiration I put into my artwork.
    Thanks for your help, I will need to be careful how much I load on one Illustrator file in the future.

  • Open a cs3 file in cs4: terribly incompatible and random crashes!

    hello dear adobe team,
    are you really serious? i mean firewoks was already buggy
    when macromedia owned it. cs3 made it buggier than ever but cs4
    shots a bullet in its head. we work here in a professional workflow
    and apps have to work without issues or the work can't be done in
    time. but firewoks is just plain and simply unusuable. in your
    responsability to the professionals and clients you shouldn't have
    realesed this version.
    in addition the compatibility between cs3 and cs4 files is
    horrible. font is not properly updated and objects have random
    shifted positions. which means hours of work when you have
    documents with 40+ frames.
    no thanks adobe. this is just not professional.

    I hope I can uninstall CS4 and go back to the unstable but
    usable CS3. I can't believe how bad this version is.
    Is it just me or are the large software companies getting too
    bloated to do a good job on any one thing? I've worked in the
    software industry as a designer for over 20 years and some things
    just seem to be getting worse with each version. Is this an attempt
    to get everyone to move to Photoshop?

  • I can't open any excel file it say's not enough memory everything else works. Thanks

    I have no clue on what is going on with my computer can anyone help?

    How many programs do you have open. Usually your machine will use the disk as scratch memory, but your program may be needing internal memory and it may not be able to address it. Close some programs backwards as to how you opened them and see if you can free some memory. If you still have a problem, I would close everything and restart opening that program first. Jerry

  • I try to open a PDF file but it will not. What can i use to read a PDF file.

    What can i use to read a PDF.

    1. Install free Adobe Reader App.
    2. Hold down attachment and "Open In" Adobe Reader
    http://i1224.photobucket.com/albums/ee374/Diavonex/fb20a68a.jpg

  • How can i open a pdf file with pdf paramter that extention is not ".pdf" in ie?

    for example: open in ie with url: "c:\\a.efb#toolbar=0 ", but it can not see anything,the "a.efb" is a sure pdf file that just change the file ext. however i can open  the file in ie without paramters!
    my english is not well,if you know what i say ,please write the answer,thanks!

    I do not know why you want to open a local file in IE, and not directly in Adobe Reader.
    Does it work if you rename the file extension to .pdf?
    If yes, then maybe it will work if you create a file association for .efb as AcroExch.Document to open with AcroRd32.exe

  • Web.show_document on XP SP2 does not open a .csv file

    XP SP2
    XE db
    Forms 10g (9.0.4)
    form90.conf:
    AliasMatch /query_exports/(..*) "C:/mydir/query_exports/$1"
    .csv file creation statement:
    lv_ext_dir := 'query_export/';
    lv_file_id := text_io.fopen(lv_ext_dir||lv_file_name,''w');
    so far so good. the file is created and written to.
    text_io.fclose(lv_file_id);
    now, the open of the file created:
    lv_temp_dir := 'query_exports/' -- note same value as above
    web.show_documents(lv_temp_dir||lv_file_name);
    at this point a new browser window is opened with HTTP 404 Not Found error. The URL is:
    http:/local_machine:8888/forms90/query_exports/"lv_file_name"
    if I go the following:
    lv_temp_dir := 'file:///c:/mydir/query_exports/'
    web.show_documents(lv_temp_dir||lv_file_name);
    The new browser does not open and I do not get an error. The file is still written to.
    If i use:
    lv_temp_dir := 'query_exports/' -- note same value as above
    web.show_documents(lv_temp_dir||lv_file_name);
    and the new browser open with the HTTP 404 Not found message and I manually type in:
    file:///c:/mydir/query_exports/"lv_file_name",
    The .csv file opens correctly.
    Why is this behavior happening?
    TIA for any help you can provide,
    Ed.

    Whats the machine name ?
    Add the machine name/networkdomain name as a trusted site under
    Internet Explorer ->Securitysettings
    Rajesh ALex

Maybe you are looking for

  • Problem with file association in Photoshop

    I am using Adobe Photoshop CS4, and I also have Adobe After Effects on my computer (which I don't use).  For some reason, when I click on a photograph in Adobe Bridge, the After Effects program opens, but the photo I want to open in Photoshop does no

  • Sub Con PO through MRP Run

    good morning all,      we are in buisness with Projects and do the MRP on project based. i have a query. all of you know that if Purchase order comes through MRP then it shows account assignment catagory and G/L account number. when we run mrp system

  • Email address doesn't work?

    Hi, I've been assigned a new BT Yahoo email address and password, but they won't work. Does that get activated when my broadband becomes active? I go live with BT on Monday but surely if a yahoo email has been setup I should be able to log in now? Al

  • SSD Flash card reader for proprietary HDD

    Hi, Im an Apple service provider, I have a late 2010 MB Air which is damaged, client wishes to retrieve data from internal hard drive, which is a Flash card, the type that uses Apples proprietary interface (its a slim stick with a connector at the bo

  • Doubt in compression of tables

    Hello, I have a doubt regarding compression of tables. I just compressed three tables in my Database and took a dump of the compressed tables. And later i took the dump of the same uncompressed tables (having same data as compressed table). But there