Click a button to run a script

hi, I'm runnning Solaris server, create a Java GUI application. I want to achieve the following task:
1) Once I click on the button on the Java GUI application, the application will invoke a script written in perl. (in this sense, the button acts a bridge to run the perl script)
Any one know how to achieve this, using what Java classes to run scripts written by other scripting language?
Thanks in advance:)

To execute other stuff (such as perl scripts), use Runtime.exec(String command). Check the API documentation for details.
(I think you are confusing yourself and setting up for bad design by dragging the button into the "how to run a script"-part of it, but that's another issue.)

Similar Messages

  • Letting user to click a button and run an application

    Hi all,
    I'm trying to do this: once the user logged on, the user can click a button to run an application. If it's the first time he/she use it, it'll let user to download the program and then run it. How can I do that?
    Thank you.
    Cal

    Find out about Java Web Start.

  • How to insert and delete fragments by clicking a button and how to script it?

    I have a  question on livecycle. I am collecting the inventor information as a bunch of text fields, each asking for a certain details. Please see below
    Now I have grouped them all in to one fragment called inventordetails and saved as .xdp file, so I could reuse this entire block. I want to add a button underneath this block, “ADD MORE INVENTORS” and when clicked this will insert another block and so forth and so on. However I was not sure as to how to insert and delete a fragment. Do  you think you can help with this? I appreciate any help in this regard.
    Best
    Subashini

    1.       I have a subform1 which is flowed
    2.       I have subform2 inside subform1 which is positioned
    3.       Inside subform2 I have two buttons 1. ADD INVENTOR 2. DELETE INVENTOR
    4.       Also inside subform1 I insert a fragment called inventor
    Now I want to script the buttons so that when clicked the inventor fragment either gets inserted again or deleted.
    I greatly appreciate any help in this regard.
    Best
    Subashini

  • HT3205 I have 7 lights on my macbook. What does it mean when the first 5 light up when I click the button?

    I have 7 lights on my macbook. What does it mean when the first 5 light up when I click the button?

    Run an Apple Hardware Test (extended version):
    http://support.apple.com/kb/ht1509
    Ciao.

  • Run a script by clicking on a button panel

    Hi,
    i am very new to scripting in after affects and in general.
    Several month ago i write severals little scripts to speeds up my workflow. I launch them via the "Launch Pad" script Panel.
    Now, i would like to put my scripts in my own panel but i'm missing the properties to link the "script part" and the "panel part".
    For the panel i have (just one button for the moment):
    win=new Window("window","new project",[0,0,500,500],{resizeable:true,});
    but_1=win.add("button",[33,16,103,36],"Sharpen3Way");
    win.center();
    win.show();
    and  my previous script that work independently.
    myComp = app.project.activeItem;
    // Selectionne la composition active
    app.beginUndoGroup("Sharpen 3 Way");              
    // Start Undo Group
    mySolid01 = myComp.layers.addSolid([100,100,100], "Sharpen", myComp.width, myComp.height,1);   // Ajoute un layer Solid
    mySolid01.adjustmentLayer = true;                                                                                             
    // Transforme le Solid en Adjustement Layer
    mySolid01.label = 5;                                                                                                                   
    // Attribue la couleur d'un Adjustement Layer
    mySolid01.opacity.setValue(40);                                                                                                  
    //  Change l'opacité du Layer
    myEffect = mySolid01.property("Effects").addProperty("Unsharp Mask").name = "Unsharp Mask Large";  
    // Ajoute un effet  sur ce calque 
    myEffect = mySolid01.Effects.property("Unsharp Mask Large")(1).setValue(10);
    myEffect = mySolid01.Effects.property("Unsharp Mask Large")(2).setValue(40);
    myEffect = mySolid01.property("Effects").addProperty("Unsharp Mask").name = "Unsharp Mask Medium";
    // Ajoute un effet  sur ce calque 
    myEffect = mySolid01.Effects.property("Unsharp Mask Medium")(1).setValue(65);
    myEffect = mySolid01.Effects.property("Unsharp Mask Medium")(2).setValue(1);
    myEffect = mySolid01.property("Effects").addProperty("Unsharp Mask").name = "Unsharp Mask Fine";    
    // Ajoute un effet  sur ce calque 
    myEffect = mySolid01.Effects.property("Unsharp Mask Fine")(1).setValue(95);
    myEffect = mySolid01.Effects.property("Unsharp Mask Fine")(2).setValue(0.5);
    app.endUndoGroup();            
    // End Undo Group
    How do i make the relation to run the script when i click on the but_1 ("Sharpen3Way")
    thanks you.

    Hi,
    if you don't have that many scripts and they are short like this, you can make them into functions, and on click events the function is called.
    A bit off topic but i think important, (1) avoid windows of type window, palettes are better, (2) you should use the keyword "var" when declaring new variables,
    (3) to make it dockable have a look at David Torno's tutorials ([Tutorial] After Effects ExtendScript Script Writing).
    Edit : And also (4) You should use matchNames (or index) to refer to properties, not english name. If you hand this script to someone who does not have AE i english, it will probably not work
    For instance myEffect should be instead: myEffect = mySolid01.property("ADBE Effect Parade").addProperty("ADBE Unsharp Mask2");
    Xavier.
    (function(){
        var win, but_1, but_2;
        win = new Window("palette","new project",[0,0,500,500],{resizeable:true,});
        but_1=win.add("button",[33,16,103,36],"Sharpen3Ways");
        but_2=win.add("button",[33+100,16,103+100,36],"Sharpen0Way");
        but_1.onClick = sharpen3Ways;
        but_2.onClick = sharpen0Way;
        win.center();
        win.show();
        function sharpen3Ways(){
            var myComp, mySolid, myEffect;
            // Selectionne la composition active
            myComp = app.project.activeItem;
            if (myComp instanceof CompItem){
                app.beginUndoGroup("Sharpen 3 Way");                  // Start Undo Group
                // Ajoute un layer Solid
                mySolid01 = myComp.layers.addSolid([100,100,100], "Sharpen", myComp.width, myComp.height,1);
                mySolid01.adjustmentLayer = true;                                                                                                      // Transforme le Solid en Adjustement Layer
                mySolid01.label = 5;                                                                                                                            // Attribue la couleur d'un Adjustement Layer
                mySolid01.transform.opacity.setValue(40);                                                                                                          //  Change l'opacité du Layer
                // Ajoute un effet  sur ce calque (unsharp mask)
                myEffect = mySolid01.property("Effects").addProperty("Unsharp Mask");
                myEffect.name = "Unsharp Mask Large";   
                myEffect(1).setValue(10);
                myEffect(2).setValue(40);
                // Ajoute un effet  sur ce calque (unsharp mask)
                myEffect = mySolid01.property("Effects").addProperty("Unsharp Mask");
                myEffect.name = "Unsharp Mask Medium"; 
                myEffect(1).setValue(65);
                myEffect(2).setValue(1);
                // Ajoute un effet  sur ce calque (unsharp mask)
                myEffect = mySolid01.property("Effects").addProperty("Unsharp Mask");
                myEffect.name = "Unsharp Mask Fine";
                myEffect(1).setValue(95);
                myEffect(2).setValue(0.5);
                app.endUndoGroup();                // End Undo Group
            else{
                // ignore or send some alert
            return;
        function sharpen0Way(){
            alert("About to do something, ... dont know yet what.");
        return;

  • How to run a script A from a button "Button 1" ?

    Hi all, I've got this problem for having a window with several buttons named "Button 1" "Button 2"... and run the script "Script A" if we click on the button 1, the script "Script B" if we click on the button 2 etc...
    Here is my short script :
    #target indesign
    //make a table of contents which send directly to the right script
    var w=new Window("dialog");
    var buttongroup=w.add("group");
    var panel=buttongroup.add("panel");
    var button1=panel.add("button",undefined,"Script A");
    var button2=panel.add("button",undefined,"Script B");
    var button3=panel.add("button",undefined,"Script C");
    var cancel=buttongroup.add("button",undefined,"Cancel",{name:'cancel'});
    buttongroup.addEventListener('click',press)
    w.show();
    function press(e){
        if(e.target.type=="button"){
            if(e.target.text=="Script A"){
                //w.close();
                app.doScript(new File("c/scriptA.jsx"),ScriptLanguage.javascript);
            else if(e.target.text=="Script B"){
                app.doScript(new File("c/scriptB.jsx"),ScriptLanguage.javascript);
            else if(e.target.text=="Script C"){
                app.doScript(new File("c/scriptC.jsx"),ScriptLanguage.javascript);
    Each script A, B and C begins with an app.dialogs.add()
    And here is the problem, it tells me that an alert or a modal dialog is already active
    I tried the w.close() but it doesn't work...
    I don't think addEventListener is what I need, maybe I'm wrong for using a window but it's the only way to give names to the buttons, isn't it ?

    Now I get it... I work both on Mac and Windows but when I tried the 'palette' I forgot that I had only the version CS4 on Windows
    (and I launched the script from the ESTK instead of the script panel..mistake !!)
    Now it works great on the Mac, thank you Peter for the help and for the pdf scriptui

  • Run PLSQL code by click on button usin javascript

    Hi
    I want to run plsql code
    on click button using javascript
    javascript is ok but code of plsql is not run
    suggest me
    APEX 4.2.1
    Oracle !!XE
    Windows Server
    Firefox 17.0.1
    Theme Cloudy
    thanks in advance
    bUTTON CODE IN PLSQL CODE AND SEND_RMNDE IS PROCEDURE
    '<button type="button" name="button1" onclick="send_rmndr('
    ||NO_DUES_MASTER.CERT_ID
    ||');" value ='
    ||NO_DUES_MASTER.CERT_ID
    ||'> '
    ||'Remind'
    ||'</button>'
    JAVASCRIPT
    <script type="text/javascript">
    function send_rmndr(pThis)
    var params='x= '+pThis;
    var get=new htmldb_Get(null,null,null,&APP_PAGE_ID.,null,'send_reminder',params);
    gReturn = get.get();
    //alert(gReturn);
    alert ('inside script ' +params);
    //get=null;
    </script>
    Edited by: 969091 on Feb 1, 2013 9:13 PM

    send_reminder needs to be defined as an application process
    Alternatively, you can define a dynamic action and do this more declaratively.
    It's easy to define a DA that fires on click of a button that runs PL/SQL, and you can also define which page items are sent to and received from the plsql via session state.
    Scott
    blog: [url grassroots-oracle.com]grassroots-oracle.com
    twitter: [url twitter.com/swesley_perth]@swesley_perth
    -- please mark any useful posts as helpful or correct, in the end it helps us all

  • Run a function in flash when click a button on HTML page

    dear friends,
    i have loaded my swf in an html/ aspx page. when i click a button in html page, i want to pause my swf movie. Actually swf has another movie clip i want to stop that. any option pls help me. possible send me some sample coadings.. i tried with externalInterface but no result..
    or if i click a button in html page, i want to run a function existing in loaded swf....
    thanks in advance...
    Thanks and Regards,
    Syed Abdul Rahim

    Dear Mr.ned,
    Greetings! i tried to put the id also, still its not working.. any ideas? find below my codings:
    flash code:
    import flash.external.ExternalInterface;
    ExternalInterface.addCallback("methodName", method );
    function method() {
        mytxt.text = "call from java script";
        trace("called from javascript");
    HTML code:
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>jscr_rd</title>
    <script language="javascript">AC_FL_RunContent = 0;</script>
    <script src="AC_RunActiveContent.js" language="javascript"></script>
    </head>
    <body bgcolor="#ffffff">
    <p>
      <!--url's used in the movie-->
      <!--text used in the movie-->
      <!--
    <p align="left"></p>
    -->
      <!-- saved from url=(0013)about:internet -->
      </script>
      <script language="javascript" type="text" >
    function methodName() {
       jscr_rd.method();
       window.alert("hi.. u clicked me?");
    </script>
      <script language="javascript">
        if (AC_FL_RunContent == 0) {
            alert("This page requires AC_RunActiveContent.js.");
        } else {
            AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','widt h','550','height','400','id','jscr_rd','align','middle','src','jscr_rd','quality','high',' bgcolor','#ffffff','name','jscr_rd','allowscriptaccess','sameDomain','allowfullscreen','fa lse','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','jscr_rd' ); //end AC code
    </script>
      <noscript>
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="jscr_rd" align="middle">
          <param name="allowScriptAccess" value="sameDomain" />
          <param name="allowFullScreen" value="false" />
          <param name="movie" value="jscr_rd.swf" />
          <param name="quality" value="high" />
          <param name="bgcolor" value="#ffffff" />   
          <embed src="jscr_rd.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="jscr_rd" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />   
      </object>
      </noscript>
    </p>
    <form name="form1" method="post" action="">
    <input name="but" type="button" value="click me" onClick="methodName()">
    </form>
    <p> </p>
    </body>
    </html>
    pls check advice me
    Thanks and Regards,
    Syed Abdul Rahim

  • Trying to makea report run when clicking a button on a form

    I am trying to run a report by clicking a button on a form (Forms 9i)
    I have modified the registry settings for FORMS90_PATH and REPORTS_PATH to include my development directory, and now at last the report is generating. However the command to display the form in a window is not doing anything at all - no error even. Can someone please help, the trigger code for my button is displayed below:
    DECLARE
         rep_result VARCHAR2(30);
    BEGIN
         SET_REPORT_OBJECT_PROPERTY('INVENTORY_REPORT', REPORT_FILENAME, :GLOBAL.project_path || 'Inventory.rdf');
         SET_REPORT_OBJECT_PROPERTY('INVENTORY_REPORT', REPORT_DESNAME, :GLOBAL.project_path || 'Inventory.htm');
         rep_result := RUN_REPORT_OBJECT('INVENTORY_REPORT');
         --MESSAGE('Rep result: ' || rep_result);
         WEB.SHOW_DOCUMENT('file:///' || :GLOBAL.project_path || 'Inventory.htm', '_blank');
         --WEB.SHOW_DOCUMENT('file:///C:\Temp\Dev\Inventory.htm', '_blank');
    END;
    thx
    adam

    Hi,
    may be this could be helpful for you:
    You have to include the following code to execute a report:
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status Varchar2(20);
    BEGIN
    repid := find_report_object(report_name);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,BATCH);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'pdf');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,report_server_name);
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := report_object_status(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    if rep_status = 'FINISHED' then
    WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
    else
    error report not exists
    end if;
    END;
    Also you have to create the report server with the command:
    "rwserver - install service_name autostart=yes
    report server name must be the same that appears in the code above
    You must add the report to run in the REPORT object type in your .fmb and put there with the same name
    The report server to install ought to be the one and only in you network to avoid mistakes...

  • I get a window pop up after every click into a new site that reads : Safari is no longer responding because of a script on the webpage "    ". Do you want to stop running the script, or let it continue? If I  click on continue it just continues,

    I get a window pop up after every click into a new site that reads : Safari is no longer responding because of a script on the webpage "    ". Do you want to stop running the script, or let it continue? If I  click on continue it just continues, stop, it stops.  How to correct this annoying message?

    Disable Javascript for those webpages.  Note, your Javascript is probably antiquated by now.  Try a different web browser, or contact the website and let them know they aren't as accessible as they could be*:
    http://www.macmaps.com/browser.html

  • How do I run a video in one cell of a table when a user clicks a button in another cell?

    In other words, I want to put 3 buttons in one cell of a table so that the user can run one of three Flash videos in a cell beside the buttons. How do I do that?
    Header 1
    Header 2
    button 1 runs video 1
    button 2 runs video 2
    button 3 runs video 3
                                     video 1, 2, or 3 is inserted here when the user clicks the button

    You will have better luck if you find a Flash Player that uses a playlist.  Direct links to FLV files don't work.
    http://www.wimpyplayer.com/
    http://www.woosterwebdesign.com/flvplayer/
    http://www.longtailvideo.com/players/jw-flv-player/
    http://flowplayer.org/
    Another option is to upload your videos to YouTube.com. You can customize a YouTube player and populate it with videos you specify.  Then paste their player embed code into your web page.
    http://code.google.com/apis/youtube/getting_started.html
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • How to run a subVI without poping up normally, but when clicking a button, popup the front panel?

    I know pop-up the front panel of a subVi when called by selecting VI Properties>>Windows apperence.
    But what I need to do is: always run the SubVI inside the parent VI as the nornal subVI do without poping up. But when I click a button"show front panel", the SubVI popup the front panel.
    Is there anyway to do this?
    Thanks,

    ossoo,
             You can use a static VI reference to the subVI and then use the Front Panel Open invoke method to show the front panel when you want. I have attached two VIs that show this. I saved these VIs for LabVIEW 2009 so you should be able to open them up and run them in 2009 or later. Add.VI is the subVI that you are calling. The Caller.VI is just a While Loop that contiually calls the Add subVI. Inside of the While Loop is also a Case Structure with a Static VI Reference (you might need to change the path this is pointing to after downloading the VIs to your computer for this to work) and the Front Panel Open invoke method. You can run the Caller.VI and interact with the main Front Panel as normal and see the subVI but then you can click the Open subVI? boolean button and it will open the subVI's front panel. You can continue to interact with the main front panel and see the values update on the subVI's front panel as well. You can just close the subVI's front panel when you are done viewing it. Does this help?
    Grant H.
    National Instruments
    LabVIEW Product Marketing Manager
    Attachments:
    Caller.vi ‏19 KB
    Add.vi ‏23 KB

  • On clicking a button run external class which refrances main application

    I have a reader ReadXML and a Jframe Cpass, on clicking a button on Cpass, an new filechooser opens, this then fills the input jtextfiled12 . When clicking "load" button on cpass I need to send jtextfiled12.getText() to ReadXML (this runs, and updates mank text fields on cPass)... but I cant reference from a static context Cpass>>ReadXML>>Cpass.... so having a problem
    relevant cPass in cPass.java:
    public class Cpass extends javax.swing.JFrame {
    public static void main(String args[]) {
    Cpass C = new Cpass();
         C.show();
    public String getIn() {        return this.jTextField12.getText();         }
    relevant ReadXML in ReadXML.java:
    public class ReadXML {
    private void ReadInXML() throws IOException {
         String XmlInText = Cpass.getIn();
              BufferedReader allData8 = new BufferedReader(new InputStreamReader
    (new FileInputStream(new File( XmlInText)),"UTF8")); }
    Edited by: Mr_Tuition on Dec 5, 2007 3:44 AM

    but since cpass is already running from cpass, i cant reinitialise it, I need to used the insatance that is already shown, since it contains the infomation needed to pass to readXML
    public static void main(String args[]) {
       Cpass C = new Cpass();
       C.show();
       }When selectinfg a button on C (which selects the file location), that then opens readXML, I cant open a new version of Cpass (since this wont contain the infomation, eg the file the user has just chosen)
    I need to run Cpass
    Click a button that selects a file
    then file location is set in a text feild on Cpass
    on selecting "load" on Cpass, this runs readXML.java
    *readXML some how gets the file location from Cpass (which is still C.show();)
    the XML is read, and sent back to Cpass via:
              public String[] getStrAllData() {
                      return this.arrayXML;
             }One way arround thios is to copy the readXML function into Cpass but thats just messy
    Another would be to write out a "cookie" type file that saves the location, then readXML can use this .. less messy, but not what I wanted.
    Edited by: Mr_Tuition on Dec 5, 2007 4:42 AM

  • When i double click home button, I can see many applications running. How do I terminate these?

    When i double click home button, I can see many applications running. How do I terminate these?

    Those are not necessarily running. It's a list of previously opened apps for the most part. You can flick the cards upwards to get rid of them.

  • How to run a batch file clicking a button?

    Hi All,
    Can you tell me anyone how to run a batch file clicking a button? And also the progress bar showing the progress.
    Arif

    As said: write the insert statement like above (of course replace the databaselink, column and table names with your own) in a stored procedure and call this procedure in the WHEN-BUTTON-PRESSED Trigger.
    As for the progress bar: how many records are you processing and how is the network connection between your database server? As above method is rather fast it might take just a few seconds and you could spare you the progress bar (this might be a little tricky to implement).
    cheers

Maybe you are looking for

  • Fingerprin​t Reader access to KeePass (from a Thinkpad with Password Manager)

    The goal: secure, convenient, automated login to password-protected sites KeyPass is a great open-source program for secure creation, storage and use of login passwords and other information. With a plugin called KeeForm, it allows very convenient au

  • PCD Index Error in Trex Search

    Dear all I have tried to configure as mentioned in the URL <b>Configuring the Search for Portal Pages and iViews</b> http://help.sap.com/saphelp_nw04/helpdata/en/b2/d59a4271c80a31e10000000a1550b0/frameset.htm . I am getting the following error. <i><b

  • Error code -304155.

    Hi all,  Here's my problem: Error -304155 occurred at niLvFpga_Open_PXIe-7975R.vi Possible reason(s): FlexRIO: Downloading to the FPGA is not supported on this OS. Please use the RIO Device Setup utility to download your bitfile to the flash, and the

  • How can I uninstall Labview run time engine from the machine?

    I understand that Labview has not given any provision to show customized 'License Agreement screen'. Isn't it? This is the main cause of my problem. Since I want to show our own license agreement (LA) screen, I made the one using Labview. To show thi

  • Errors, time machine wont go more than 15Go

    Hi I start time machine the backup begin. Than stop 15,2 Go onthe 133,6 Go it should back up! Il try several thing. 1 reformat the External HD be "Mac OS Extended (Journaled)" and Select GUID 2 redonne the partitionning "Volume Scheme" choose "1 part