How to get the response of a vbscript ran from extended js?

Hi All,
I  want to get the result from a vbscript, how to get that in my jsx? This is what I'm doing-
vbscript (this will return me something, i've added just a sample string)
Wscript.Echo "Like this?"
jsx
var a = File("C:\\Users\\Sahil\\AppData\\Roaming\\CreativeWorx\\1.vbs");
var b=a.execute();
Now, variable b returns me true/false; and the output i.e. "Like this?"  is alerted! So my question is-
1. How to get the output in a variable?
2. How to avoid the alert
So, I simply wish to get the output from my vbscript and then perform certain functions accordingly, alos, I dont want  this to be alerted!
Any help will be highly appreciated!

The capitalization is app.doScript and not app.doscript that is if you are trying to get a jsx script to run and access a string from from a vbs script.
When defining the VBscript for multiline scripts the easiest method is to use triple quotes
VBscript = """dim WMI:  set WMI = GetObject("winmgmts:\\.\root\cimv2")
dim Nads: set Nads = WMI.ExecQuery("Select * from Win32_NetworkAdapter where physicaladapter=true")
dim nad
for each Nad in Nads
    if not isnull(Nad.MACAddress) then Wscript.Echo Nad.description, Nad.MACAddress  
next"""
when using the scriptArgs you can either make a loop of them and send the string value of each one something like this
For (n = 0 .........
myArg = "myArg" & n
myStringToPassOver = "Shaddow Fax " & n
app.scriptArgs.SetValue myArg, myStringToPassOver
Next
or probably better to make a long comma or something else separated string and pass it over after the loop
var VBScript = """myArg = ""
For n = 0 To 15
myArg = myArg & "Shaddow Fax " & n & ","
Next
app.scriptArgs.SetValue "myResult", myArg
app.doScript(VBScript, ScriptLanguage.visualBasic);
var myResult = app.scriptArgs.getValue("myResult").replace(/\,$/,"").split(",");
// if neaded use "replace" to remove final "," and "split" to convert into an array
alert(myResult.join("\r")); // alert the array
The above script is a jsx script that runs a vbs
If you want a vbs script to run and access a string from from a jsx script then you would use xxx.DoScript see the sample from the manual below.
Set myInDesign = CreateObject("InDesign.Application")
myJavaScript = "alert(""First argument: "" + arguments[0] + ""\rSecond argument: "" +
arguments[1]);"
myInDesign.DoScript myJavaScript, idScriptLanguage.idJavascript, Array("Hello from
DoScript", "Your message here.")
myVBScript = "msgbox arguments(1), vbOKOnly, ""First argument: "" & arguments(0)"
myInDesign.DoScript myVBScript, idScriptLanguage.idVisualBasic, Array("Hello from
DoScript", "Your message here.")
P.s.Please mark the question as answered, thanks

Similar Messages

  • How to get the form reference in .js page from .jsp page

    hi
    i have written one form in jsp page omething like:-
    <html:form action="/shopping" onsubmit="return false;">
    can anybody tell me,how to get the form reference in .js page from .jsp page ,
    i have tried:-
    var formRef = document.forms[0];
    butits not working.
    Thanks.

    Its very simple......y cant u prefer google...Bad
    c this example...
    function submit()
    alert("textbox"+ document.forms[0].name.value);//to get textbox value in js
    document.forms[0].submit();//to submit jsp page using js
    <html:html>
    <html:form action="/shopping" onsubmit="submit()">
    <html:text property=name>
    learn to search in google..
    </html:form>
    </html:html>

  • How to get the absolute path of a file from the local disk given the file n

    how to get the absolute path of a file from the local disk given the file name

    // will look for the file at the current working directory
    // this is wherever you start the Java application (cound be C: and your
    // application is located in C:/myapp, but the working dir is C:/
    File file = new File("README.txt"); 
    if (file != null && file.exists())
        String absolutePath = file.getAbsolutePath();

  • JMS to WebService - how to get the response?!

    Well i am receiving data from JMS-CC and sending it to WebService. But there is no response?! Do i have to use the Synch/Asynch bridge because we are on SP12?!
    And if i want to get the response to SOAP-Sender-CC - how do the URL has to look like and how do i implement the URL in the sending WSDL?!
    br
    Message was edited by:
            Carsten Heinrich

    you can try to use async-sync bridge
    http://help.sap.com/saphelp_nw70/helpdata/en/45/20d251c20a0732e10000000a155369/frameset.htm
    Florin

  • How to get the Response Code when a URL is launched from Web Dynpro

    Hello Experts,
    I have a Web Dynpro Application in which in one of its views i have an IFrame UI element in which i will show a resource stored somewhere ..
    But before showing it i want to check if the resource actually exists. For this i have to check the HTTP Response code from Web Dynpro Application without setting it in the Iframe..
    I am using the following code to get the Response Code:
    try{
    URL url = new URL("Some Url");
    HttpURLConnection.setFollowRedirects(false);
    HttpURLConnection connection = (HttpURLConnection) url.openConnection();
    connection.connect();
    wdComponentAPI.getMessageManager().reportSuccess("Response code ="+connection.getResponseCode());
    }catch(Exception e){
    wdComponentAPI.getMessageManager().reportSuccess("Exception");
    Now the Problem is whatever response Code occurs 403 (for No Proper Authorization), 404 (for Resource not found) etc..
    i always get Response Code=  500 (which is for Internal Server Error) shown in the messgae i have printed.
    Please let me know the correct way of getting the Response Code from Web Dynpro.
    Also my resource is lying on a SAP Portal 6.4
    Best Regards
    Sundeep
    Edited by: Sundeep Sethi on Feb 18, 2008 9:07 AM
    Edited by: Sundeep Sethi on Feb 18, 2008 10:23 AM

    Hi,
      Check this code from /thread/5242768 [original link is broken] if it works.
    try{
    URL myurl = new URL("http://calendar.google.com");
    URLConnection connection = myurl.openConnection();
    if(connection instanceof HttpURLConnection) {
    HttpURLConnection httpConnection = (HttpURLConnection) connection;
    HttpURLConnection.setFollowRedirects(true);
    httpConnection.setRequestMethod("HEAD");
    httpConnection.connect();
    System.out.println("Response = "+httpConnection.getResponseCode());
    catch(Exception e) {
    // print exception
    Regards,
    Harini S

  • HOW TO GET THE SELECTED VALUE IN A ROW FROM ONE VIEW TO ANOTHER VIEW?

    hi all,
    I  have a small issue.
    i have created two views.In the table of the first view i'm selecting a row and pressing the button it will move to next view.
    i am adding some fields manually in the table of the second view and pressing the save button.Here all the values should get updated corresponding to the field which i have selected in the first view.
    I want to know how to get the particular field in the selected row from one view to another view.
    Kindly help me.

    Hi,
            Any data sharing accross views can be achiveved by defining CONTEXT data in COMPONENT CONTROLLER and mapping it to the CONTEXT of all the views. Follow the below steps.
    1. Define a CONTEXT NODE in component controller
    2. Define same CONTEXT NODE in all the views where this has to be accessed & changed.
    3. Go to CONTEXT NODE of each view, right click on the node and choose DEFINE MAPPING.
    This is how you map CONTEXT NODE and same can be accessed/changed from any VIEW or even from COMPONENT CONTROLLER. Any change happens at one VIEW will be automatically available in others.
    Check the below link for more info regarding same.
    [http://help.sap.com/saphelp_nw04s/helpdata/EN/48/444941db42f423e10000000a155106/content.htm]
    Regards,
    Manne.

  • How to get the field row name of database from a form?

    Hello experts,
    I am newer in OIM and developments with the API's.
    I have this environment,
    one resource that have the attribute department
    relationship with the database row
    UD_RESOURCE1_DEPARTMENT and other resource with the same attribute in, UD_RESOURCE2_DEPARTMENT
    I am programing one java class that put values in the
    form field through the table name, sample,
    UD_RESOURCE_DEPARTMENT.
    I let some code:
    # Hash table with the value of Department
    myMap.put("UD_RESOURCE_DEPARTMENT", value);
    # and save in the resource form
    tcFormInstanceOperationsIntf tcform = (tcFormInstanceOperationsIntf)tcUtilityFactory.getUtility(dataProvider,"Thor.API.Operations.tcFormInstanceOperationsIntf");
    tcform.setProcessFormData(Long.parseLong(formKey), myMap);
    But this solution implies know the name of the field in the database and not is a global solution.
    I am interesting in know how I can obtain the name of the
    row field of the database for the atribute. Does anybody know how to obtain the row field name of database from an IT Resource or through the field name of the form?
    Is this the correct way to store data in a form?
    Thanks in advanced.

    Hi,
    Thank you.
    I have seen this function in the OTN help, but how can i get the index number. My requirment is when saving the data, I need to save both the value and the element name into the database,
    Also it is tabular block, more than one rows
    Thanks again

  • How to get the planned quantity of past month from md61

    Hi all,
           I couldnt get the planned quantity of past month from the tcode md61.It shows only the current and future month's demand.I want to know the planned quantity of past month's.
    I have checked PBIM,PBED,PBHI tables,here also I am facing the same problem.
        Is it possible to get past month quantity from md61? If No how to know the quantity planned for past month?...Please tel your ideas..
    Thanks in Advance!!!
    Edited by: Ranganayahi Chandirasekaran on Jul 30, 2008 8:17 AM

    Hi,
    You can check History of PIR through MD62 itself.
    Select particular row, Goto Menu, Select Item History(Shift +F6).
    Or
    You may pls execute transaction MD73.
    Plz select option "3 :History Planned ind reqmnts " in the display options and execute the report.
    Regards,
    R.Brahmankar

  • How to get the URL parameter value when navigating from JSP Page to portal

    Hi All,
    I have web Dynpro application with one button, while clicking that button It will navigate to JSP page as external window. In the JSP page I have a input field and Button.
    In the JSP page input field I will enter some values and press submit button, it will navigate to Portal page by passing some URL parameter with values.
    Once user entering to portal by default WD page displayed, the same WD page I try to get the URL Parameter which I have passed from JSP page, but I am not able to get the URL parameter value.
    If same application running in without portal, I can able to get the URL parameter values. I am getting the URL parameter by interface view default inbound plug parameter.
    How do we resolve this problem?
    Regards,
    Boopathi M

    Hi
    Please try  these link might helpful for you
    1.[How to call WebDynPro application from JSP |/thread/452762 [original link is broken];
    2.[How to get the previous page url from abstract portal component? |/thread/1289256 [original link is broken];
    3.[how to launch and pass a parameter |/thread/5537 [original link is broken];
    Best Regards
    Satish Kumar

  • How to get the member of cost element group from Profit center group

    Hi Guys,
                  I need to get the member of cost element group from Profit center group like in Tcode KCH3 and the same from Account Group like in Tcode KDH3.
    Any Function Module available to get this data.
    Thank U for Ur time.
    Cheers
    Senthil

    I am closing this thread.

  • How to Get the Current data into Planning Layout from the Planning cube

    Hi,
    I have a problem in BPS.   I am selecting the data from cube based on Month org details but I want to see the latest data.   How can i get this data into planning cube.
    Like
    data
    Tran           cal month            org               amt
    1                 jan                        a                  100
    1                 feb                        a                   200
    if i want to read based on Tran org as input values I shoud get the below data but I am getting the previous data.   
    Tran           cal month            org               amt
    1                 feb                        a                   200
    Kindly help me in this regard
    Thanks
    Naveen

    Naveen,
        Are yo having issue when you save something in the layout, the data doesn't appear in the listcube ? Or do you have issue that the latest data you see in the cube doesn't appear in the layout ?
    For the former issue, please look at your selections of listcube and for the second issue, please check your planning level definition, make sure all the restrictions you have applied are valid for this latest data to be presented in the layout.
    Hope this helps.
    Cheers
    Srini

  • How to get the Full and final settelment date from PC_payresults

    Hi Experts..sairam.
    We are preparing Functional specification  for a report on Full and final settelement.
    We need to extract the  full and final settelement date from  payresults.
    Full and final settelement would be an offcycle run.
    How can we identify the particular Offcycle is meant for full and final settelment.
    Full and final settelement can be done after date of relieving.
    Please share your ideas to get the field names and logic to fetch.
    Thanks in advance.
    Regards,
    Sairam.

    Hi Praveen,
    I found it from HRPY_RGDIR through SE11.
    But im in confusion in thinking on Logic to find the Full and final settelment processed date.
    First of all..Report has to check WPBP table weather Employment status is Zero.
    Later..It has to read the HRPY_RGDIR table.
    Here what the system to check.What conditions to be validated to fetch the Full and final settelment processed date.Will it be FPPER and INPER as 00000000 or shall we do it from offcycle reason.
    Please share your ideas.Thanks in advance.
    Regards,Sairam.

  • How to get the number of issued active certifcates from a CA

    Hi,
    We have a PKI infrastructure still running on Windows Server 2003. How can I get the number of active certificates issued?  I have used the filter option on the issued certifcates node listing the certificates with expiry date after the current
    date, but this list only all the certs without the actual total number of certs.
    Any help is appreciated
    Thanks
    Johan Marais
    JkM6228

    On Wed, 22 Jan 2014 08:57:59 +0000, Martin Rublik wrote:
    certutil -config -view -out "Issued Distinguished Name" -restrict "Certificate Expiration Date > 22. 1. 2013" | findstr Rows
    It will dump CA database look for issued distinguished name (name in the subject of the certificate) and outputs only certificates expiring after 22.1.2013. The output is piped to findstr command that filters the total number of rows.
    There are a couple of problems with the above:
    1. Not every certificate will have a Subject name.
    2. This won't filter out certificates that have been revoked but are still
    time valid.
    3. I couldn't get the "findstr Rows" to return anything and when I look at
    the help for findstr I don't see that as an option for the command.
    This command worked for me, make sure you enter it all on a single line:
    certutil -view -restrict "Disposition=20,NotBefore<January 22 2013" -out
    SerialNumber | findstr /C:"Serial Number:" | findstr /r /n "^" | find /c :"
    Also, if you copy and paste from this post into the cmd window, be careful
    that the quotes and dashes don't get converted into the wrong type.
    Paul Adare - FIM CM MVP
    "for thing in $(fnord $(frob $(./gazonk foo bar baz bletch thud grunt)));
    do
    zot --wodchuck ${thing}; done"
    -- Stig Sandbeck Mathisen making a point about the beauty of shell scripts

  • How to get the real name of a user from WFSYST-AGENT

    Hi,
    I am retrieving the WFSYST-AGENT value (which correspond to the US<user_id> of the agent responsible of a task) in a container variable in my workflow.
    I would like to get the real name of the user represented by WFSYST-AGENT. How should I do that ?
    Thanks in advance for your help.
    Thibault

    Hi,
    Take the user name and write a select for database table USER_ADDR fetching fields NAME_FIRST and NAME_LAST by passing BNAME = username.
    Regards,
    Jayesh

  • How to get the document type, name and revision from the search page cv04n

    Hello,
    After performing cv04n and getting a list of documents satisfying the search criteria, how can I then get the document type, name and revision of the selected document using ABAP?
    Thanks

    HI,
    IN table DRAW... u have Document type, Version and document number.
    In Table DRAT also u get Document Type, Version, Number and Description of Doucment.
    Regards
    SAB

Maybe you are looking for

  • HT5622 How can I transfer an apple credit from one account to another?

    I have money in my apple account a credit and my brother wants to transfer his money to mine so I can buy apps how can he transfer his credit to my account without entering a credit card.

  • Open Dataset for input in BINARY MODE not working after ECC 6.0 upgrade

    Hi All, Our requirement is to download an XML file from the application server and there is a customized program to download these files. This program uses the statement,  Open dataset ...for input in BINARY MODE and it works perfect for 4.7. There w

  • Applets Error!!!

    Hello, I am new to Java. I have a problem with applets. I have an applet that reads information from a file and prints it to a text area. I am able to view the results via appletviewer but not via the browser. I have done the HTMLConverter also, but

  • Office 4 Mac Installation Disk Won't Load

    When I try to insert and install the Office 4 Mac 2004 disk into my new MacBook Pro...I get a finder error message saying the application is not supported on this system?? Any ideas?

  • 0COPC_C04

    Hello Experts we are loading the data into cube: 0COPC_C04 Inventory valuation: material prices and inventory values. For this cube there are 6 different infosource that is supplying the data into cube. 1. 0CO_PC_ACT_05 2. 0CO_PC_ACT_07 3. 0CO_PC_ACT