Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

UI scripting with ProI 3.3

Pkilford

New member
#


is it possible to run an uncompiled java scriptfile from the command line


i have a list of rtp forms i want to produce a report for each of these forms


the list will change


so at present i have created a iece vbs that looks works through the list and creates a java file that does all the processing for each of the files


CAN ANYONE THINK OF ANOTHER WAY TO DO IT
 
One way: Build your java file again and again for each iteration and then compile it from the command line before running it. I call this technique compile-on-the-fly and have used it successfully in the past.


Better way: Use a single, compiled UI script that references environment variables. Then have your vbs (or batch file, or similar) script set the appropriate environment variables before running the UI script each time.


Below is a simple sample of an Intralink script set up to use environment variables to automatically log in to Intralink:


-Brian





// Version: Intralink v.3.2, (build #2003120 - I4.0.5.25)
// Start Macro Recording
import com.ptc.intralink.client.script.*;
import com.ptc.intralink.script.*;
import java.lang.Runtime;
import java.util.*;
import java.io.*;
public class param5 extends ILIntralinkScript {
ILIntralinkScriptInterface IL = (ILIntralinkScriptInterface)getScriptInterface();
private void run0 () throws Exception {


Process p1 = Runtime.getRuntime().exec("cmd.exe /c echo %ilinkusername%");
BufferedReader br1 = new BufferedReader( new InputStreamReader( p1.getInputStream() ) );
String UsernameStr = br1.readLine();


Process p2 = Runtime.getRuntime().exec("cmd.exe /c echo %ilinkpassword%");
BufferedReader br2 = new BufferedReader( new InputStreamReader( p2.getInputStream() ) );
String PasswordStr = br2.readLine();


IL.openWindow( "Login", UsernameStr, null ); // recorded step: 1
IL.setLoginParameter( "INTRALINK_PASSWD", PasswordStr ); // recorded step: 2
IL.ok( ); // recorded step: 3
...
...
...
Edited by: Brian_Adkins
 

Sponsor

Articles From 3DCAD World

Back
Top