PDA

View Full Version : trying to run simple applescript




ScKaSx
Aug 7, 2007, 10:29 PM
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



kainjow
Aug 8, 2007, 08:11 AM
You need to change the .command file's permissions. Run: chmod u+x myfile.command

ScKaSx
Aug 8, 2007, 01:18 PM
Hi Kainjow,

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

Cheers,
ScKaSx