applescript error

Discussion in 'Mac Programming' started by natcarish, Jun 27, 2009.

  1. macrumors newbie

    Joined:
    Jun 27, 2009
    Location:
    UK - Glastonbury
    #1
    I have been using this script for some time now with no problems, but suddenly I get this error (I have updated the OS since using it), any ideas as to what's wrong? All the folders definitely exist.

    script:

    tell application "Finder"
    set destination to choose folder with prompt "Choose the destination"
    choose folder with prompt "Choose the Job folder"
    set subfolders to every folder of result
    repeat with thisSubfolder in subfolders
    repeat with ProcessedFolder in thisSubfolder
    tell application "Finder"
    if name of ProcessedFolder contains "Output" then
    if not (exists (folder (((destination as alias) as text) & ((name of ProcessedFolder) as text)))) then
    if (count items of ProcessedFolder) > 0 then
    copy folder (ProcessedFolder as alias) to folder (destination as alias)
    end if
    end if
    end if
    end tell
    end repeat
    end repeat
    end tell


    Event log:

    tell application "Finder"
    choose folder with prompt "Choose the destination"
    alias "G-DRIVE mini:5031DA_Going_Out_Formal_David_Anthony:"
    choose folder with prompt "Choose the Job folder"
    alias "HD370:5031DA:"
    get every folder of alias "HD370:5031DA:"
    "Finder got an error: Can’t get alias \"HD370:5031DA:\"."
     
  2. macrumors 65816

    mysterytramp

    Joined:
    Jul 17, 2008
    Location:
    Maryland
    #2
    I ran the script on my machine, but commented out the second tell block. Checked event log and result history and everything seemed to work fine. I'm running Leopard.

    mt
     
  3. macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #3
    Hang on...what happened to the thread before? It had like 10 replies in it?
     
  4. thread starter macrumors newbie

    Joined:
    Jun 27, 2009
    Location:
    UK - Glastonbury
    #4
    re: applescript error

    I tried that, but it's still the same; besides, the error occurs before it even reaches the second 'tell' block.
     
  5. thread starter macrumors newbie

    Joined:
    Jun 27, 2009
    Location:
    UK - Glastonbury
    #5
    re: applescript error

    Well, that's typically weird computer. I restarted the machine (I had done this before) and now it works as normal???

    This machine is definitely acquiring an attitude!
     

Share This Page