trying to run simple applescript

Discussion in 'Mac Programming' started by ScKaSx, Aug 7, 2007.

  1. macrumors regular

    Joined:
    Feb 27, 2006
    #1
    I was trying to run this simple apple script:

    #!/bin/sh
    # Script RunVi.command
    osascript <<EOF
    tell app "Terminal"
    set number of rows of first window to 34
    set number of columns of first window to 96
    set custom title of first window to "VI Editor"
    end tell
    EOF
    vi $@

    However, when I try running this in the terminal or by double-clicking in the folder it reads the following error:

    "The .command file ‘*.command’ could not open. Most likely it is not executable."

    Anyone know what is going on, it doesn't make sense to me. Right now the path for the script is in: Home/Lib*/Application Support/Terminal/

    Thanks,
    ScKaSx
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    You need to change the .command file's permissions. Run:
    Code:
    chmod u+x myfile.command
     
  3. thread starter macrumors regular

    Joined:
    Feb 27, 2006
    #3
    Thanks!

    Hi Kainjow,

    Thanks that works! Arg, its always the permissions that get me.

    Cheers,
    ScKaSx
     

Share This Page