How to run VB of JSX and return a value?

Someone knows how to do this?

$.writeln('result:\r' + app.doScript('wsh.echo "test"', ScriptLanguage.VISUAL_BASIC));

WSH and wscript give an error 'object required '. Same script works very well as a vbs file.

It seems that these objects are simply not available when executing doScript, but y at - it another way to return a value?

Justin Putney says:

Substances. wrote:

FWIW, to return a value from VB using doScript, you need returnValue = SomeValue at the end of your VB script.

I know that this is the case with a Sub or Function... is that his operation at the end of a script as well?

To answer your questions, here is an excerpt of work I have that gets the file in Excel:

var vbs = 'Set MyXL = GetObject(, "Excel.Application")\r' +
'Set ActiveXL = MyXL.activeworkbook\r'+
'returnValue = ActiveXL.Path';
var path = app.doScript(vbs,ScriptLanguage.VISUAL_BASIC);

Tags: InDesign

Similar Questions

  • How to execute a Perl script and returns the value as a string?

    Hi, I am trying to build an application using the eclipse 2.0.0 with the Blackberry SDK 7.1 plug-in. currently I tested Simulator 9900 version 7.1.0.523. I need to use the Perl language to access the raw biological database and returns as a string without having to write a longer program using java.

    In a stand alone Java SDK, I can use the line:

    Process p = Runtime.getRuntime () .exec ("perl script.pl")

    but when I tried to use it on the IDE for a Blackberry project, the project will not compile. It is said:

    Method exec (String) is undefined for the type of Runtime

    Hopes, can someone show me the correct syntex to use, but if no class is available, could someone show me a sample for unified research process? The names of blackberry dev is very complicated, I can't find any samples for her.

    Thank you.

    Seems interesting.

    Your idea was to download the data to the BlackBerry and then directly execute queries.

    Although there are a number of other obstacles, the first fall you in East platforms supporting Perl.  Here is the list:

    http://perldoc.Perl.org/perlport.html#supported-platforms

    BlackBerry OS Java is not included - in fact the only ' included phone OS is Symbian.  Interestingly, it seems likely that PlayBook and BB10, because they are based on the QNX operating system.

    If we discard Perl as a query language, then you will need to provide another option to search.  I think that unified search is an option, but you will have some work to do to use it.  The first thing you should do is find out if in fact, you can download the database on the BlackBerry.  The only available on the Blackberry database engine's SQL, so if you want the database can be exported to a SQL database, there is a chance that it would work.  I had a quick glance around the site, and I can't tell what the "database" is in the format.  Then I suggest that look you at that next.

    I hope this helps.

  • How to run in offline mode and to avoid delays of the internet?

    I have many machines on a subnet that is unable to access the internet.

    When running the latest versions of the Adobe Reader software there are big break where the player blocks attempts to contact files.acrobat.com.

    What is everything you need uncheck on Edit/Preferences to avoid this pause.  I have already disabled the update, updates to certificate of trust and security setings for a server loading.

    Hello

    Please see the subject of the following forum once.

    How to run in offline mode and to avoid delays of the internet?

    Concerning

    Sukrit diallo

  • How can I unintstall Firefox 7 and return to 6?

    I downloaded Firefox 7 because it says to upgrade. Well and good, but now my Norton Security Safe (Norton Toolbar) that has all of my passwords is more work. How can I get that back? It is not at all and I have to manually check to all the Favorites. Pure pain. If there is no solution how to uninstall 7 and return to 6? I'm not a geek so please just do it.

    You must have Firefox 7.0 before making the Norton Live Update or you will not get the necessary updates for Firefox 7.0. I'm not sure what Norton recommends now, but when Firefox 5.0 and 6.0 have been released and users of Norton to update Norton before they installed the updated version Norton IIRC said to reinstall all of the Norton Security program after the new update of Firefox has been installed to solve problems related to their application.

    If you are serious about getting rid of Norton, take a look at Avira Personal free - there is no need to install any type of Firefox Add-on which IMO is what causes all these problems during updates of Firefox.

    Avira Personal free - http://www.free-av.com/

  • How to allow users to sign and return the forms fillable

    Hello

    I completed a form to complete with a signature box (it is a registration form) to send to the users. I got responses that say (based on the extended rights) that the form can be completed and saved but not signed or signed and completed but not recorded.

    is it possible to have the form completed, signed and returned.

    My apologies if I'm missing something really obvious.

    Thank you

    (should mention I use convert function Echosign, but some fields have javascript that is not sopported after conversion).

    It should be, since compatible with Acrobat Pro documents will be signed digitally sign digital applied right use, allowing player.

  • How to create a fast forward and return quick button?

    I would like to create a simple fast forward and return quick button. I get sporadic results with the rewind button. I love the playhead for 3 seconds (72 images) both when the user press the fast forward or rewind button. They should be able to hit two buttons repeatedly. If the playback head is less than 3 seconds, then it will go to the first image.

    Here is the code:

    var FrameNumRewind:Number = this.currentFrame;

    FrameNumRewind = 0

    stage.addEventListener (MouseEvent.MOUSE_DOWN, page_watch);

    function page_watch(event:MouseEvent):void

    {

    If (event.target is bnt_Fast)

    {

    var FrameNumFast:Number = this.currentFrame;

    this.gotoAndPlay FrameNumFast += (72);

    }

    If (event.target is bnt_Rewind)

    {

    Will head frame to the first frame if less 73 executives.

    If (FrameNumRewind < = 73)

    {

    SoundMixer.stopAll ();

    this.gotoAndPlay("1") ;}

    }

    on the other

    {

    this.gotoAndPlay (FrameNumRewind-= 72);

    }

    }

    What I am doing wrong? Is there a better way to do it?

    I would appreaciate any help or references.

    One thing, that you must take care, is that you should not nest functions named within other functions.  Remove this function ff72 by itself.

    The currentFrame property is a read-only property, but you try to change its value using code in this line...

    this.gotoAndPlay this.currentFrame += (72);

    So change that line to be

    gotoAndPlay (currentFrame + 72);

    noticing that I took out "this" references as well.  They are most often useless in AS3 scenarios.

  • Execute and return a value (or object) from another script

    I wish I could have some of the functions of the little that I often use in my scripts, just like seporate scripts. so I can then update in one place and do not copy in every script, I want to use them in.

    I don't know if this is possible at all. But I'd love to be able to just call them and return of their share values somehow.

    for example

    Swatches of color key code, I need:

            var inCutColorCMYK = cmykColor(50, 0, 100, 0);
            var intCutSPOT = makeSwatch("CutIN", inCutColorCMYK);
    

    so I have these functions I have tweeked/found:

       function makeSwatch( swName, swCol) {  
        var doc = app.activeDocument;
        var sel = doc.selection;
        if (!inCollection(doc.swatches, swName)) {  
        var aSwatch = doc.spots.add();  
        aSwatch.name = swName;  
        aSwatch.color = swCol;  
        aSwatch.tint = 100;  
        aSwatch.colorType = ColorModel.SPOT;  
        var aSwatchSpot = new SpotColor();  
        aSwatchSpot.spot = aSwatch;  
        return aSwatchSpot;  
        }else{  
            return doc.swatches.getByName(swName);  
            }  
        };
    
    
    function cmykColor(c, m, y, k) {  
        var newCMYK = new CMYKColor();  
        newCMYK.cyan = c;  
        newCMYK.magenta = m;  
        newCMYK.yellow = y;  
        newCMYK.black = k;  
        return newCMYK;  
        };
    
    
    
    
    function inCollection(collection, nameString) {  
           var exists = false;  
       try{
        for (var i = 0; i < collection.length; i++) {  
            if (collection[i].name == nameString) {  
                exists = true;  
                }  
            }  
        }catch(e){//alert("Illustrator needs drop kicked!!\nPlease restart Illustrator :/\n\n"+e)
            }
            return exists;  
            
          };
    

    in any case! I keep finding my self using functions like that again and again new scripts and hope there is a way to do this!

    Any help is appreciated!

    -Boyd

    You have the file a.jsx, something like myLibrary.jsx, and in it, you can have all the functions for future use. In the file, it can look like this:

    ------------------------------------ Library file -----------------------------------

    #target illustrator

    function MyLibrary() {}

    this.cmykColor = function (c, m, y, k) {}

    var newCMYK = new CMYKColor();

    newCMYK.cyan = c;

    newCMYK.magenta = m;

    newCMYK.yellow = y;

    newCMYK.black = k;

    Return newCMYK;

    };

    function applyFillColorTo (item, color) {}

    item.fillColor = color;

    }

    function CataloguedPathItem (pathItem) {}

    var p = pathItem;

    p.applyFillColor = {function (color)}

    applyFillColorTo (this, color);

    };

    return p;

    }

    this.cataloguedPathItem = {function (pathItem)}

    var p = new CataloguedPathItem (pathItem);

    return p;

    }

    };

    ----------------------------------------------------------------------------------------

    And then you can understand and use this file in other scripts, like here:
    -------------------------------------- Script File ---------------------------------

    #target illustrator

    #include 'C:\\Users\\Me\\Desktop\\My Adobe Scripts\\Illustrator\\MyLibrary.jsx.

    function test() {}

    var MyLib = new MyLibrary(); the script library is used as an object - elements of its scope of application are available through point (.) as mylib.myFunction ();

    If (app.documents.length > 0) {}

    var doc = app.activeDocument;

    If (doc.selection.length > 0) {}

    var MonElement = mylib.cataloguedPathItem(doc.selection[0]);

    var mylib.cmykColor (0,100,50,0) = myColor;

    myItem.applyFillColor (myColor);

    }

    } else {}

    Alert ("there is no open document.");

    }

    }

    test();

    ----------------------------------------------------------------------------------------

    The colors test script just a pathItem, but it uses functions from the inside of the object of 'library' to power the process. Note that to use the library of color a path implied instantiate this path as a custom which is a 'applyFillColor' method that uses a function of the scope of the library (called "applyFillColorTo") for power. Then, we can not simply the function "applyFillColorTo" use within the scope of the Script file because it is protected by the MyLibrary object.

  • Call a jscript vbscript script and return a value

    Hello world

    I'm trying to simplify a tedious task: every day I have to fill in an InDesign document with 48 different numbers that go into 48 blocks of text. I would like to write a script to get these numbers (the temperatures that I get in an excel file) automatically and write them in the corresponding text blocks.

    So basically I use jscript to implement a document. So I want him to call a vbscript script (since only vbscript can retrieve an excel cell value) and have it return the value to the jscript in a variable.

    So far I managed to adapt a .vbs script that retrieves the number of the cell and the poster in a box:

    Option Explicit
    Dim objApp, objWbs, objWorkbook, objSheet

    Set objApp = New
    Set objWbs = objApp.WorkBooks
    objApp.Visible = False
    Set objWorkbook = objWbs.Open ("C:\Temperature")
    Set objSheet = objWorkbook.Sheets ("Sheet1")

    MsgBox objSheet.Range ("C5"). Value

    objWorkbook.Close False
    objWbs.Close
    objApp.Quit

    ObjSheet = Nothing set
    Set objWorkbook = Nothing
    Set objWbs = Nothing
    Set objApp = Nothing

    But it is only that. I always have trouble with:

    (1) the order doScript: How can I call the jscript vbscript script?

    (2) writes the value retrieved (or table) in a variable in vbscript script

    The rest is easy: in the jscript, write the table in the corresponding text blocks.

    Hope someone can help me. Thank you very much

    Maphio M.

    When you place an Excel file in InDesign, it becomes a table. From there on, it's a simple as myFrame.tables [0] .cells [x] .silence (myFrame being a reference to the image that you placed the Excel file in).

  • How to run the external monitor and Portege S100 together

    I am trying to add a second monitor to my S100. But I can't get the second monitor screen and laptop to work at the same time. (Display settings never 'sees' a single monitor.)

    Other forums on this site suggests that it is something to do with the factory presets. But I can't find out how to change these on my system. Any ideas? I am running Windows Vista Home Premium.

    Hello

    Usuallyy, you can switch between display devices using the function FN + F5 key.
    Have you tested this function?

  • How to perform a necessary task and return to the original page where the obligation was first listed?

    I tried this post a while ago, but I don't think I managed. I hope that this post is not a rehearsal. If this is the case, please forgive me for my mistake.

    *

    While I try to download the creative cloud at 60% of the original price for my smart phone, however, I get an error saying to remove the desktop application.  I had tried earlier install the desktop version, a mistake. I thought that the installation was not complete because I received a message stating that the I need to connect to my computer at home and then try to install the desktop version of creative cloud.

    How to uninstall the desktop version without losing the offer of 60% off the creative cloud?

    How to return to the page where the error message to uninstall the desktop version?

    Thanks for you help.

    A.L.F.

    I don't know what you saw that offered 60%, unless you qualify for an education discount, students & teachers .  This is the page of adobe with plans of non-education, pricing and membership creative cloud | Adobe Creative Cloud

    and you can uninstall any cc on your desktop.

    clean through the use of the Adobe Creative Cloud cleaning tool to solve installation problems

    Restart your computer

    install the application of office cc, https://creative.adobe.com/products/creative-cloud

    You can use the desktop application to install cc trials and, if you have or get a subscription, install non-epreuve versions and convert the non-proces tests.

  • How to uninstall Adobe Acrobat DC and return to 11 Acrobat or an earlier version.

    Some users love Adobe Acrobat DC, but I find it is horrible and the desire to return to something more easy to use and navigate.

    It is preferable to Adobe Acrobat 11 or earlier.

    Hi Mark,

    If you are not happy and satisfied with Acrobat DC, you can easily return to 11 Acrobat.

    Please see the following link for information on how to get down to 11 Acrobat Acrobat DC.

    You could certainly downgrade to just last previous version of the last one, that is to say 11 Acrobat now.

    Acrobat DC uninstalled Acrobat XI | How to get Acrobat XI

    Hope this will help.

    Concerning

    Sukrit diallo

  • How to run tenants melted precision and outs in the middle of the clamp for mounting in hearing spoken 6.0?

    Unfortunately, I like many others, had to move to Windows 7 from Windows XP and not all features in Audition 3.0 will run on Windows 7. I am now using hearing 6.0. I edit tracks of voice of spoken for several networks. Often in the edition in the "Edit Mode" must be melted or not a specific word when taking the failures or errors or rebuild a sentence to his natural. 3.0 has been intuitive and easy to use that I could define a range and determine EXACTLY how I wanted to fade the ins and outs of sound. It seems that 6.0 designers forgot that fades of precision are needed in the middle of a clip for the edition of spoken word in the edit view. The only way I see is to use the fade in and out in the 'Favorites' pull-down menu and highlight the range of the predetermined fade. It seems that 6.0 developers are only concerned about fading the beginnings and the ends of a clip. With each new feature 6.0, the simplest and the most important functions in 3.0 have been abolished or made less usable. After use Syntrillium Cool Edit 2000 at each iteration of Adobe Audition, Audition 5.0 was a disaster and 6.0 is somehow an improvement. I did thousands of hours of network programming and work of voiceover using Audition 1.5 and 3.0. I hope that Adobe listens to its loyal user base.

    I understand your concerns on the future of this software. I cut my teeth back to Cool Edit 1.0 and have loved it since then. Tweaks that happened since then were not so good.

    To fade you speak, I want to go into the menu to --> Amplitude Compression &--> bland envelope. There you can choose an envelope tweaks to share model and on the other a clip and bend it to your needs.

    Steve

  • How to close a browser window and return to an anchor named on a page in another window

    I'm working on a Web site that contains several book images at the bottom of each page. I put in place so that when the user clicks on a book, another smaller browser window opens with a description of the book. At the bottom of the window of description of book, I have a close button that I added the Window.Close () behavior. But I would like not only to have the window close but to return the user to the bottom of the original page where I have some books, a field that I applied an anchor named at. Any ideas on how I can get this done.

    I'd appreciate any help.

    I tried not to customize this lightbox extension a lot.  But I'm sure that the box size is predetermined by the size of the image.  Larger image, larger box.  And which is encoded in one of the jQuery javascript libraries.

    As for placing a link in the legend, of course.  Just paste your html link code into the Lightbox caption Panel as follows.

    http://Amazon.com"> buy now on Amazon»

    There is much more information on the viewer and how it works on the site crowded together.

    http://www.huddletogether.com/projects/lightbox/

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    www.Alt-Web.com/
    www.Twitter.com/ALTWEB

  • The Menu bar and status bar disappeared, but the worst of all the tabs is at the top of my computer. It's very annoying! How can I uninstall Firefox 4 and return to the old?

    Please tell me how I can go back to the old format

    If you don't like the new look of Firefox 4, then you can change some settings to restore the appearance of Firefox 3.

    You can right click on the orange Firefox button to open the menu of the toolbar or use (F10) view > toolbars.

    • Click on the entry in the Menu bar to make the menus visible bar.
    • Click "Tabs at the top" to remove the check mark and place the tab to its original position bar just above the browser window.

    You can use this extension to retrieve the status bar:

  • How can I uninstall windows 7 and return to windows vista?

    Uninstall windows 7 Home premium

    How to uninstall windows 7 Home premium package and re install windows vista Home premium SP1

    Given what you have...

    Get/use your Windows Vista Home Premium media (and product key) to start to go and destroy (create new partitions and format) everything that you installed and install again.

    Once you have Windows Vista Home Premium installed, get SP1 and SP2 (in order) to get Vista to update Service Pack, then get all the post-SP2 hotfixes/updates to update installed.

    You also need to locate, download, and install all the drivers for hardware devices,-either by the manufacturer of the computer as a whole (if it's a Dell, Lenovo, Gateway, HP, etc.) or by each manufacturer of components support pages (Intel, Realtek, various manufacturers of motherboard, AMD/ATI, nVidia, Broadcom, etc..)

    You can then install all other applications (office suites, photo-editing suites, video editing suites, Internet plugins, alternative browsers, Internet plugins, etc) and activate the paid applications using the appropriate series/product numbers.

    At this point, you can restore all your backups (documents, music, photos, emails, contacts, databases, spreadsheets, presentations, Favorites/internet Favorites, etc.) on the computer.

Maybe you are looking for