I’m at my wits’ end. I’m trying ultimately to call a perl parsing tool that will split a text into parts, check data and then recombine the parts.
At this stage I’m just trying to write an AppleScript that will let me choose the file I need and then run the perl script with the correct option. Here is what I have:
set myFile to choose file with prompt “Project folder :” default location “/Users/bowjest/Documents/Projects/Texts”
do shell script “/usr/bin/perl /Users/bowjest/Documents/Scripts/target_extract.pl -e” & myFile
It has taken me ages to get to this point: the first line was easy, but everything I’ve tried so far in line 2 has just bombed. Now I’m getting the error:
“No option specified. You must specify -e or -m option. Exiting.”
But I have specified the option, but somehow my syntax must be off.
Can anyone offer some advice on where I’ve gone wrong?
Unfortunately, I’ve tried adding the space (as well as quite a few other things), but to no avail.
The only way I can get the script to be called and run is if I expressly set the full path:
do shell script "/usr/bin/perl /Users/Bowjest/Tools/Automator/ParseTMX/target_extract.pl -e /Users/Bowjest/project_save.tmx"
It doesn’t seem to like the variable I’ve set, using the same code to select a file in another app worked fine, so I really don’t understand why it’s not working here.
To be explicit: running the two lines of code:
Enables me to navigate and select a file
But the process then ends with an error message (different according to whether I put a space after -e or not, whether I’ve got myFile in quotes or not, etc.)
Is the problem with the way I’ve selected the file or assigned the variable in the first line:
set myFile to choose file with prompt "Project folder :" default location "/Users/bowjest/Documents/Projects/Texts"