Open Unix-program from inside a certain folder

Hi @ all

i know, the subject sounds a bit spongy, but what i need is the following:

Via Terminal I usually go to a certain folder on my hd and start matlab from there.

The problem is that the folder is DEEEEEP inside my HD so the path’s length is a hell to type.

The script

do shell script “cd /Users/me/now/starts/the/longest/path/one/would/like/to/imagine/when/not/drunk/; matlab;”

returns that the matlab-command is no valid command.

If I use the terminal, everything works as it should.

I know, the problem is utterly trivial, but i can’t find the solution.

Thanks for any hint

joh

Hi,

try this


set pathToMatlab to "/Users/me/now/starts/the/longest/path/one/would/like/to/imagine/when/not/drunk/matlab"
do shell script quoted form of pathToMatlab

Am I wrong but can’t you just drag your folder from finder or spotlight into the terminal window?

Hi Stefan,

thanks very much for your quick reply.

I tried your idea, but for some reason unknown to me I get the following error:

But that doesn’t make any sense for me.

Do you have a clue what might be the cause oft he note?

Regards

joh

Might be possible, but i want to build a shortcut using Spark, so that ML starts from the folder in want just by hitting whatever cut.

Regards

joh

permission denied means permission denied :wink:
Maybe you run the UNIX executable in terminal.app as root

:smiley:

I’m fully aware of the menaning, but it doesnt make any sense. I’m running the command from the shell as user “me”. The Script has the same priviledges, simply because i’m running it. So it’s senseless, don’t you agree?

All the best

joh