Jump to content

This topic is 5553 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am working with an external Java app that I have to open and pass parameters to. It works great on windows, but I am having difficulty making it work on Mac.

Here is the code for windows

Send Event["aevt"; "odoc"; "cmd /d /c java -jar " & Quote ( "C:Documents and SettingsNickLocal SettingsTemp1OEtempDxcUploader.jar" ) & " -file " & Quote ( "C:Documents and SettingsNickLocal SettingsTemp1OEtempdxupload.txt" ) & " -password " & PT_Docs::DX_Pass & " -source EDI -url https://somewebsite.com/dci/upload.svl -username " & PT_Docs::DX_User & " -responsefile " & Quote ( "C:Documents and SettingsNickLocal SettingsTemp1OEtempdxresponse.txt" )]

On Mac I have tried Send Event and AppleScript and cannot find a solution. In AppleScript I can get the file to open, but do not know how to pass along the parameters.

Any help would be greatly appreciated.

Posted

Learn about the applescript do shell script method:

Like this (example only)

Perform applescript:

set cmd to "java -x 123 -y 74 -f"

do shell script cmd

Simple real example:

Set cmd to "cd /applications; ls"

do shell script cmd

copy result to cell "Result" of current record

Posted

I have figured out how to make the java app launch using "do shell script", but you have to put everything after "do shell script" in quotes and several of my arguments have to be in quotes, see example.

do shell script "cd /path/to/folder;java -jar DxcUploader.jar -file "dxupload.txt" -password pass -source EDI -url https://website.com/dci/upload.svl -username user -responsefile "dxresponse.txt""

The java app is failing and I believe it is because of the quotes. Is there any other way to make this work?

This topic is 5553 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.