Applescript: Error when setting default location with choose file dialog box

Discussion in 'Mac Programming' started by nathangdavis, Mar 30, 2011.

  1. nathangdavis, Mar 30, 2011
    Last edited: Mar 30, 2011

    nathangdavis macrumors newbie

    Joined:
    Mar 30, 2011
    #1
    Please HELP! I have been racking my brain about this for way too long. I am trying to set a default location and it's giving me an error saying...

    File "MEDIA:iMovie Projects:" wasn't found


    And the folder is definitely there. Have tried with and without using "as alias"


    Without "as alias" it tells me

    Can't make "MEDIA:iMovie Projects:" into type alias

    Here is my code.


    set project to choose file with prompt "Locate the PROJECTS file path and click OK" default location "MEDIA:iMovie Projects"
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    This worked for me:
    Code:
    [b]set[/b] [color=#408000]project[/color] [b]to[/b] [b][color=#0016b0]choose file[/color][/b] [color=#0016b0]with prompt[/color] "Locate the PROJECTS file path and click OK" [color=#0016b0]default location[/color] [i][color=#0000ff]alias[/color][/i] "MEDIA:iMovie Projects"
     
  3. nathangdavis thread starter macrumors newbie

    Joined:
    Mar 30, 2011
    #3
    Trying this gives me the error...


    File alias Volumes:MEDIA:iMovie Projects of <<script>> wasn't found.


    Also, it works fine when I use this line...

    set project to choose file with prompt "Locate the PROJECTS file path and click OK" default location (path to home folder)


    But I can't get it to work with variable with the filepath as text or typing the path directly in.

    NOTE: My MEDIA drive is the name of my hard drive not a folder.
     

Share This Page