I’m not sure what you are suggesting with your first suggestion but I’m sure bash doesn’t understand ‘quoted form of’. As to the second suggestion, that was one of the many variations I tried. It gets the error I posted.
Then you’re not telling us enough with this one line. Why are you passing a path this way? In AppleScript that’s just a line of text - you’re not setting a variable. Why do you need the osascript in the line? Are you executing this from the terminal or as part of a do shell script? We have no context.
can you post the shell script? or an approximation? as adam said, it’s hard to figure out what you are trying to do. post the script, and we can also run it and get the same error. then we can debug.
do shell script "osascript " & (quoted form of POSIX path of (choose file))
‘choose file’ will return an alias to the file you select. If that file is a script it will be executed in the terminal. If you create a script with the following code
return path to me as text
and save it then choose it from the first script it will return the path (in Apple Finder format)
Thanks for the reply. I got half of it figured out. I was using the ‘-e’ option in the script. By removing that the syntax error went away. Now I just get a no such file or directory error. I think that simplifies things in the sense that now it is a matter of getting the right string past the shell. It does the same thing from the command line but here is the script anyway:
#!/bin/sh
pdfprintdir=“/Volumes/Common/Tiiff to PDF/print queue/stage”
pcount=ls "$pdfprintdir" | wc -l
if [ $pcount -gt 0 ] ; then
/usr/bin/osascript “Server\ HD:Library:Scripts:Folder\ Action\ Scripts:print files.scpt”
fi
That just returned what I’ve already tried (the path was in quotes with no escape of spaces). It resulted in the same error. Thanks anyway, it is a clever idea that I can see other uses for so I filed it away.