AnsweredAssumed Answered

Problem with script

Question asked by Roger_1 on May 21, 2012
Latest reply on May 24, 2012 by Sorbsbuster

Title

Problem with script

Post

I am trying to get the following script to work. I am sure it is in my path but can not seem to find the right combination.

The following works fine - do shell script "open ~/desktop/v001.tif"

 

This dose not - do shell script "open ~/Macintosh HD 2/pictures/wells images/v001/v001_007.tif"

I get the following message

The files /Users/rogerwells/Macintosh, /HD, /2/pictures/wells, and /images/v001/v001_007.tif do not exist.

 

I got this to work:

do shell script "open /Macintosh\\ HD\\ 2/pictures/wells\\ images/v001/v001_007.tif"

So it looks like the spaces caused my problem here.

 

So the last question how do I get this into a variable?

do shell script "open " $path

where $path would = /Macintosh\\ HD\\ 2/pictures/wells\\ images/v001/v001_007.tif

 

I want to do the following  do shell script Variable  

Where the variable is the path to the picture

Any help would be appreciated as this is the first shell script I have tried to do.

 

Thanks

Roger

Outcomes