M
mansky99
Hi,
I have a Perl script that I want to call from VB via the MacScript
function via Applescript. The Perl script takes an argument and I am having
trouble getting MacScript to handle the passed argument.
Here's the snippet of VB code:
.... in-line Applescript here
Etime = MacScript(ASArg)
Debug.Print Str(Etime)
'Call Perl script, via Applescript to convert Etime to HH:MM:SS format
ASArg2 = "set Etime2 to do shell script
""/Users/ed/Codes/DBscripts/ConvertTime.pl -t """ + Str(Etime)
Debug.Print ASArg2
Debug.Print Etime2
Etime2 = MacScript(Str(ASArg2))
Here's the debug output:
190
set Etime2 to do shell script "/Users/ed/Codes/DBscripts/ConvertTime.pl -t "
190
The argument I want to pass (Etime) is the returned value from a previous
Applescript call via MacScript.
If I declare ASArg2 to be a String, I get a Run-time error #5. If I declare
ASArg2 as a Variant and wrap ASArg2 inside a Str function inside the second
call to MacScript, I get a run-time error #13.
The problem seems to me to get the last literal quote to enclose the passed
argument.
So the question is, how, in VB, do I embed a variable inside a literal
string and thereby pass an argument thru MacScript, to the target script?
Any ideas are greatly appreciated!
Ed
I have a Perl script that I want to call from VB via the MacScript
function via Applescript. The Perl script takes an argument and I am having
trouble getting MacScript to handle the passed argument.
Here's the snippet of VB code:
.... in-line Applescript here
Etime = MacScript(ASArg)
Debug.Print Str(Etime)
'Call Perl script, via Applescript to convert Etime to HH:MM:SS format
ASArg2 = "set Etime2 to do shell script
""/Users/ed/Codes/DBscripts/ConvertTime.pl -t """ + Str(Etime)
Debug.Print ASArg2
Debug.Print Etime2
Etime2 = MacScript(Str(ASArg2))
Here's the debug output:
190
set Etime2 to do shell script "/Users/ed/Codes/DBscripts/ConvertTime.pl -t "
190
The argument I want to pass (Etime) is the returned value from a previous
Applescript call via MacScript.
If I declare ASArg2 to be a String, I get a Run-time error #5. If I declare
ASArg2 as a Variant and wrap ASArg2 inside a Str function inside the second
call to MacScript, I get a run-time error #13.
The problem seems to me to get the last literal quote to enclose the passed
argument.
So the question is, how, in VB, do I embed a variable inside a literal
string and thereby pass an argument thru MacScript, to the target script?
Any ideas are greatly appreciated!
Ed