DoScript VBScript to VBScript?

I would like to have serveral common VBScripts that are run by different VBScripts. Would the DoScript command be the correct choice to do this? Below is a script that I'm working on that has several Functions. I would like to put each Function in a separate VBScript. I will have maybe 30 or more scripts that all do the same thing, just the size, quantity and template will change (below is for a N12, will also need N10, N24, etc.) and would like to avoid having each script have the same set of Functions.
Thanks,
Archie
Rem N12 Script
Rem SCRIPT INFO
Rem -----------
Rem Copyright Mindware Corporation Of America
Rem Author: Archie O Tucker
Rem Created: 03/03/08
Rem Revised:
Dim myInDesign
Set myInDesign = CreateObject("InDesign.Application.CS3")
Set myDialog = myInDesign.Dialogs.Add
Set FileSys = CreateObject("Scripting.FileSystemObject")
Rem SET VALUES
Rem ----------
Dim MountSize
Dim TemplateFolder
myMountLetter = "N"
myMountSize = "12"
myMountNumber = "8"
myTextFolder = "E:\sxs\pm65\CA\"
Rem myTextFolder = "X:\SXS_Test\pm65\CA\"
myTemplateFolder = "E:\SXS\ID\"
Rem myTemplateFolder = "X:\SXS_Test\ID\"
myBatchFolder = "E:\SXS\ID\"
Rem myBatchFolder = "X:\SXS_Test\ID\"
myTemplateName = myTemplateFolder + myMountLetter + myMountSize + ".indt"
Rem DISPLAY DIALOG
Rem --------------
myDialog.Name = myMountLetter + myMountSize + " Autobatch "
Set myDialogColumn = myDialog.DialogColumns.Add
set myBorderPanel = myDialogColumn.BorderPanels.Add
set mySubDialogColumn = myBorderPanel.DialogColumns.Add
Set myBatchNumberLabel = mySubDialogColumn.StaticTexts.Add
myBatchNumberLabel.StaticLabel = "Batch Number: "
Set mySubDialogColumn = myBorderPanel.DialogColumns.Add
Set myBatchNumberField = mySubDialogColumn.TextEditboxes.Add
myBatchNumberField.EditContents = "65926C" REM *** For Testing ***
myBatchNumberField.MinWidth = 100
myResult = myDialog.Show
If myResult = True Then
myBatchNumber = myBatchNumberField.EditContents
myOpenTemplate myDocument, myTemplateName
myDefineColors myDocument
myPlaceText myDocument, myTextFolder, myMountSize, MyBatchNumber
myMakeTextFit myDocument
myPlaceGraphics myDocument, myMountNumber
mySaveBatch myInDesign, myBatchFolder, myBatchNumber
myCloseTemplate myInDesign
myDialog.Destroy
Else
myDialog.Destroy
myCloseTemplate myInDesign
End If
Rem OPEN TEMPLATE
Rem -------------
Function myOpenTemplate (myDocument, myTemplateName)
Set myDocument = myInDesign.Open(myTemplateName, True)
End Function
Rem PLACE TEXT FUNCTION
Rem -------------------
Function myPlaceText (myDocument, myTextFolder, myMountSize, myBatchNumber)
Set myTextFrames = myDocument.TextFrames
Set myFirstFrame = myTextFrames.Item(1)
myFirstFrame.Place (myTextFolder + myMountSize + "_" + myBatchNumber + ".TXT")
MsgBox "Ok:"
End Function
Rem MAKE TEXT FIT
Rem -------------
Function myMakeTextFit (myDocument)
Set myCurrentFrame = myDocument.TextFrames.Item(1)
myHorizontalScale = 100
Do While myCurrentFrame.overflows = true
myHorizontalScale = myHorizontalScale - 1
Set myText = myCurrentFrame.Characters.Item(1)
With myText
.HorizontalScale = myHorizontalScale
End With
Loop
End Function
Rem PLACE GRAPHICS
Rem --------------
Function myPlaceGraphics (myDocument, myMountNumber)
For I = 1 to cInt(myMountNumber)
Rem For I = 4 to myDocument.TextFrames.Count
Set myCurrentFrame = myDocument.TextFrames.Item(I)
myCharacterCount = MyCurrentFrame.Characters.Count
If myCharacterCount > 0 Then
If left(myCurrentFrame.Texts.Item(1).Contents,7) = "[place=" Then
myFile = Mid(myCurrentFrame.Texts.Item(1).Contents,8)
myFile = Split(myFile,"]")(0)' get all to "]"
Set myGraphic = myDocument.Pages.Item(1).Place (myFile)
Set myGraphic = myGraphic.Item(1)
Set myRectangle = myGraphic.Parent
myGraphicBounds = myRectangle.GeometricBounds
myGraphicWidth = myG

From the list of available references, select Adobe InDesign CS5 Type Library, and click OK. If the library
does not appear in the list of available references, click Browse and locate and select the file Resources
for Visual Basic.tlb, which is usually inside C:\Documents and Settings\<username>\Application
Data\Adobe\InDesign\Version 7.0\Scripting Support\ (where <username> is your user name).
If necessary, search for the file. Once you locate the file, click Open to add the reference to your project
Ensure that you have the tlb file in place if you want exploar the file to see if this recomento corrupted the following software:
http://www.teusdejong.nl/thome/ho_body5.html

Similar Messages

  • 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

  • JavaScript doScript commands fail to initiate VBScript

    I have a JavaScript that runs a VBScript to do some SendKeys statements (to load a Keyboard Set).  This script worked fine in CS4...but fails in CS5.5.
    The ExtendScript debugger reports:  "Unable to load Adobe InDesign CS5.5 Type Library (Version 1.0)."
    That lead me to this KnowledgeBase article (kb408389):  http://helpx.adobe.com/legacy/kb/javascript-doscript-commands-fail-initiate.html.
    I tried the fix mentioned in the KDB article (as written and with changes to reflect the different CS version as well as the actual path to the .tlb file on my system) and this has not helped.
    Thoughts?
    Thanks much!
    --Aaron

    From the list of available references, select Adobe InDesign CS5 Type Library, and click OK. If the library
    does not appear in the list of available references, click Browse and locate and select the file Resources
    for Visual Basic.tlb, which is usually inside C:\Documents and Settings\<username>\Application
    Data\Adobe\InDesign\Version 7.0\Scripting Support\ (where <username> is your user name).
    If necessary, search for the file. Once you locate the file, click Open to add the reference to your project
    Ensure that you have the tlb file in place if you want exploar the file to see if this recomento corrupted the following software:
    http://www.teusdejong.nl/thome/ho_body5.html

  • Unable to load Adobe InDesign CC 2014 Type Library (Version 1.0)

    Good evening,
    I've just upgraded ID from CC to CC 2014 and now a script that had always run without issue now won't work. I get an error saying 'Unable to load Adobe InDesign CC 2014 Type Library (Version 1.0)'
    The bit of code I was running was executing a little VB script copying files:
            var vbScript = 'Set fs = CreateObject("Scripting.FileSystemObject")\r';
            vbScript +=  'fs.CopyFile "' + f.fsName.replace("\\", "\\\\") + '", "' + destinationFolder.fsName.replace("\\", "\\\\") + "\\" + f.name + '"';
            app.doScript(vbScript, ScriptLanguage.visualBasic);
    From trawling the net I can see stuff about the 'Resources for Visual Basic.tlb' file. I can see this in the C:\ProgramData\Adobe\InDesign\Version 10.0\en_GB\Scripting Support\10.1 folder but clearly it isn't registered or something similar.
    Can anyone help me get past this problem?
    Thanks for any help.

    Thanks for your prompt reply.
    Do you mean copy the 'Resources for Visual Basic.tlb' into the Version 9 folder?
    If so I already have the file in there: "C:\ProgramData\Adobe\InDesign\Version 9.0\en_US\Scripting Support\9.0\Resources for Visual Basic.tlb" as well as the file in this location: "C:\ProgramData\Adobe\InDesign\Version 10.0\en_US\Scripting Support\10.1\Resources for Visual Basic.tlb"
    The only difference between the 2 installs that I can see is that v10 also has a locale for en_GB.

  • Ipod and Windows Vista - VBScript

    When trying to downlaod Itunes 7.1.1 - I am getting an error message "Itunes can not be installed beacuse Visual Basic Script is not installed or has been diabled". Dell tried downlaoding it still the same error message. They say Apple is not compadable with Itunes yet.

    even though the following document talks about Windows XP rather than Vista, try using the instructions for registering VBScript.dll from it:
    iTunes and QuickTime for Windows cannot be installed without Visual Basic Script (VBScript)

  • Can No Longer Read Uninstall Keys with vbscript package run by SCCM

    Hi, 
    I've been using vbscript packages in SCCM for over a decade, and one thing I do is use the registry to determine if I need to uninstall an old program with the Value:
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
    or
    HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
    Example code snip:
    UnstKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{81BE0B17-563B-45D4-B198-5721E6C665CD}"
    UnstVal = wshShell.RegRead(UnstKey & "\UninstallString")
    If I run this manually, it works great, but all of a sudden, when I run a vbscript like this in SCCM it now returns: 
    Invalid root in registry key "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{...}\UninstallString"
    I normally run everything whether or not a user is logged on as System, but I did a test, and it even fails if I run the package as the user, which really surprised me. I check permissions in registry key, and Everyone has read, System has Modify.
    This code was working about a month ago. No changes to SCCM that I know. Sadly, we are still running 2007 SP2
    Please help!

    If anyone else stumbles on this issue, you're almost certainly running into the issue with 64bit clients.  Config Manager Agent runs as a 32bit process so won't read the registry key from the location you're expecting.  This uninstall strings will
    be in the following location:
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\
    If you need an existing VBScript to run you'll want to call the following:
    %windir%\Sysnative\wscript.exe 
    Hope this helps.  I should have spotted this with my Config Manager earlier.  Had me scratching my head for a while.

  • Need help in writing a vbscript

    Hi,
    I need help in wring a vbscript. I have serached for the vbscript on the net, but could not find any.
    I need to add a file to an msi using vbscript. - That's the requirement.
    For this I have done the following with the help of vbscript.
    1. With the insert statement I inserted a new copmonent in the FeatureComponent Table.
    2. Now the next thing I did is, I inserted a new row in the File table using insert statement again. The file is uncompressed.
    3. Since the file is a non-version file I also added a row in the MSIFileHash table.
    4. Also, now added the Component in the component table.
    After doing this I am able to see the chnages in the mst, however whrn I try to install it I get an error 2725 (Invalid database tables).
    Can somebody please post a vbscript which can add a file to an msi?

    Hi All,
    Thanks for all your responses.
    Yes, It is not so easy. I never said it was.  Thanks for pointing out Orca. We use Orca on a daily basis.
    What exactly I am looking at, is this.
    We have some standard applications which needs to be repackaged every month. The repackaging process is same and does not change at least for these packages. So I was actually looking at automating these things.
    What I did so far.
    First we have created an object for Windows installer. I have then taken a copy of the original msi and then opened the database of this temporary msi database in transact mode. Once the database is opened we can use select, insert, update
    and delete statements to update the database.  
    I could successfully add a registry to the msi. The component was also added successfully to the component table. I also could make changes to the Property table.
    The tricky part comes with the addition of file to the file table.
    The addition of file requires the following steps.
    1. Add a new row to the file table. This can be done with the Insert statement.
    2. We then need to associate the file to a new component or any other component already existing in the msi. In my case I am creating a new component.
    3. We then have to associate this components to a feature in the FeatureComponents table.
    4. Since the file I am adding is a non-versioned file, a new row also has to be added to the MSIFILEHASH table.
    I could see the changes that I have done using the mst. But when I try to install the msi with the mst, I get the error 2725. I checked everything. All the other steps except for the file addition works fine.
    To check whether I am indeed right, I have did this.
    Skipped the file addition part to the msi. Every other change that I make works and I am able to install the msi with the mst successfully.
    For obvious security reasons I will not be able to share the vbscript with you. If you guys think, that this is not a right forum for this question, please let me know the right forum. I have been stuck with this issue from the past 6 months. Any help would
    really be appreciated.

  • VBScript editor with Intellisense/Code Hinting support for Adobe App

    I am looking for some tool to write my InDesign VBScript files in. I would really like to know if there is any which support Intellisense/Code hinting for Adobe programs (InDesign especialy). Do you have anything to recommend?
    I am quite good at hacking my computer, so no registry change etc. is a problem for me, I just can not find any. I already tried PrimalScript 2009 but it doesn not work.
    What I need is that in following block of code
    Set myInDesign = CreateObject("InDesign.Application.CS4")
    Set myDialog = myInDesign.Dialogs.Add
    I will get list of all methods/properties after I write the dot after "myInDesign" in second line. But it never worked. I even tried to put "InDesign.Application.CS4/C:\ProgramData\Adobe\InDesign\Version 6.0\cs_CZ\Scripting Support\6.0\Resources for Visual Basic.tlb" line into Options>Text editor>Type libraries.
    I am using Windows Vista SP1 and I have Adobe Creative Suite CS4 installed (upgrade from CS3 which was upgraded from CS2)
    Thanks a lot for any help/suggestion, as I start feeling desperate.

    Hi Everyone!
    As I have said, I waited for next service release, which is as of now PrimalScript 2009 version 5.0.614 and I did some testing with it.
    Results:
    WinXP EN Professional
    - Just pointing PrimalScript 2009 to typelib, no creative suite installed, working
    - Installed Creative Suite CS3 Czech (trial mode) - Working, no need to setup anything
    - Installed Creative Suite CS3 + CS4 Czech (trial mode) - Need to point PrimalScript 2009 to correct typelib, then 100% working
    Windows Vista SP1 Ultimate EN (in trial/not activated mode)
    - Just pointing PrimalScript 2009 to typelib, no creative suite installed, working
    - Installed Creative Suite CS3 Czech (trial mode) - Need to point PrimalScript 2009 to correct typelib, then 100% working
    - Installed Creative Suite CS3 + CS4 Czech (trial mode) - Need to point PrimalScript 2009 to correct typelib, then 100% working
    Windows 7
    I am not planning to use Win7 in near future, so I did not not run any test on it.
    Windows Vista SP1 Home Premium Slovak (fully activated)
    - Installed Creative Suite CS3 + CS4 Czech (full mode) - Not working. This is my main machine. It is Creative Suite CS2 upgraded to CS3 then CS4 (it is running for years without reinstall). I use CS3/CS4 side by side for some older projects. There are still references to CS2 in registry. I tried pointing PrimalScript 2009 to correct typelib, but to no avail. My conclussion is that there is someting messed with its config or registry, but I am pretty sure it would run after complete system reinstall.
    Both WinXP EN Pro and Vista SP1 Ultimate EN were clean install into MS Virtual PC 2007, with only Creative Suite and PrimalScript 2009 5.0.614 installed into each machine so I made sure there are no other issues involved.
    As I spend 80% of my time with developement of websites and scripting of MS Office/Creative Suite, I have some virtual machines set up for testing purposes. I will use one of them for development in PrimalScript and move it to main (real) Windows Vista Home Premium Slovak installed once I will decide to completely reinstall it. The need for seting up the typelibray link is no deal for me, as it is working as expected then, and I expect a lot ;-)
    So problem solved, I found o program I will use. There may be others which do better or are cheaper (but I do not know about any) but $299 is not a big issue when I get what I want.
    P.S.: The solution with making VBScript code with VBA declaration (using Dim) is not a solution I like, as I would need to comment it out everytime I run/edit  the script and it would be pain in the *** while debugging it as i would need to do lot of comment/uncomment cycles and i can use my ime better then doing the monkey work as some fo the scripts I write are quite huge and I prefer to build them incrementaly and test/debug a lot.
    I wish to thank everyone for their help and suggestions,
    Matus

  • Call a Vbscript from a stored procedure

    Hi,
    I wonder is it possible to call a Vbscript from a stored procedure, any good reference for this.
    thanks

    Well here is quick and dirty example I just created.
    Step 1. Create a test_batch.bat file that creates a folder "c:\test_dir" and copy "c:emp.lst" into it.
    C:\oracle102\examples\test_batch.bat
    md c:\test_dir
    copy c:\emp.lst c:\test_dir
    Step2. From SQLPLUS, spool scott.emp into c:\emp.lst and call the batch from the dbms_scheduler that kicks off right away,
    set echo off
    set feedback off
    spool c:\emp.lst;
    select * from scott.emp;
    spool off;
    begin
         dbms_scheduler.create_job(job_name => 'run_batch',
         job_type => 'EXECUTABLE',
         job_action => 'C:\oracle102\examples\test_batch.bat',
         start_date => sysdate,
         enabled => true,
         comments => 'Run VB Script');
    end;
    Check if the directory is created and if the file is copied over. Task is to kick off the executable and test is the VBscript within the batch. Challenge is how long the script runs before the next statement in the PL/SQL runs. May be you have to introduce sleep in between.
    Note: You must have at least "CREATE JOB" privilege.
    Happy coding!
    Prakash
    Message was edited by:
    Prakash Rai

  • Trying to simply connect to Oracle with VBscript/ASP - and I cannot.

    This is rather embarrassing. I am pretty fluent with ASP and VBscript, and I have written many a web application connecting to Microsoft SQL Server. Now I have a need to connect to an Oracle database, and I'm beating my head against the wall.
    1) Web server is Windows Server 2003 SP1
    2) Using ASP (not ASP.NET) & VBscript
    3) I have installed the Oracle drivers on the server - it is version 10g
    4) The administrator of the Oracle database to which I want to connect has created a username and password for me to use from within my code
    5) Here is the code I am trying to run:
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open "Provider=MSDAORA;Data Source=XXXXXXX;User Id=YYYYYYY;Password=ZZZZZZZ;"
    That's it. 2 lines of code just trying to establish a connection. Using the user name and password provided to me by the administrator, and for Data Source I am using the IP address of the Oracle server (like I have done in the past when connecting to SQL Server). I receive the following error message when viewing this in a browser:
    Microsoft OLE DB Provider for Oracle error '80004005'
    ORA-12154: TNS:could not resolve the connect identifier specified
    Evidently, the Data Source I am using is not correct, but I was provided no other information from the admin. This is the first time any of us have tried to connect to Oracle using ASP/VBScript, so the administrator isn't sure what I need to do ... any help would be so appreciated.

    Hello,
    I got mine to work by setting up an ODBC System DSN and connecting to it. I think this bypasses the Microsoft driver, which might be what's causing the problem.
    Set Db = Server.CreateObject("ADODB.Connection")
    Db.Open "DSN=TEST;User ID=userid;Password=password;"
    Good luck, I've found it requires a lot of persistence...
    Al
    Springfield, MO

  • How to open and edit a VBscript file?

    Hi,
    I'm fairly proficient with Dreamweaver CS3.  However, i'm finding one aspect of CS4 to be baffling to the extreme.
    I work with VBScript files.  When I open up a script file that includes other script files, the name of the parent file is seen on a tab (with an x to the right of it).  Below it are tabs for all of the files that are included (via an include statement in the code).  That's nice.
    When I click on one of the included files I see that file show up in my window.  However, I am unable at this point to get back to the file that included this one; i.e., the master file that is still above the other files.
    If I click on the tab for the master file, I don't see the contents of this file.  If I click on the small white paper icon (with the top right corner folded) on the left navigation bar, I see the name of the master file.  Selecting it still doesn't fill my editor window with the master file.
    There is a little symbol on the right side of the tabs for the included files.  (It looks like >>, except the arrows face down.)  This has the list of all of the files that I have open, minus the master file.
    It is very hard to believe that Dreamweaver would make CS4 this hard to use.  Unfortunately, I have no idea how to get the master file back in the editor window after I have clicked on one of the files it includes.  Can anyone point me in the right direction?  thanks.

    Hi,
    Use JDeveloper to import the mwp project .In Jdeveloper,File->Import->ToplinkWorkbench->Select the .mwp file and can work from JDeveloper in editing the tlmap.xml and session.xml.
    Regards,
    P.Vinay Kumar

  • VBscript and Process Responding to flag a script exit?

    Hey All
    I work for a small game company called The Good Mood Creators and I am trying to build a software kit that can be handed to someone, and with minimal effort on their part. Copy the folder to their PC, plug in an xbox controller, click the BEGIN.*** and play
    while our testing tools and streaming software have a chance to successfully start.
    FYI I do not program for our game..
    The tool I am including with this kit is a controller emulator (XBCE) that allows us to print controller input directly to the screen.
    I am using Open Broadcasting Software to stream gameplay to a private twitch channel via a simple batch called in this vb.
    My problem is that XBCE often hangs, and with some computers requires reinstalling .NET frameworks as well as the full directx distribution before updating again to get it to start. When it works however, XBCE will hang once started 1/10 times or so, then
    randomly a few times in a row. I don't want the remote playtester to start recording video before the tools are started. So I wrote a script that checks to see if the program is running a short time after its been started.
    <job>
    <script language="VBScript">
    Option Explicit
    On Error GoTo 0
    Dim os
    Dim wmi
    Dim procs
    set os=CreateObject("WScript.Shell")
    set wmi = GetObject ("winmgmts:")
    os.CurrentDirectory = "C:\Users\Public\TESTPC-remote\"
    os.run "XBCE.exe"
    While True
        Set procs = wmi.ExecQuery("select * from Win32_Process Where Name = 'XBCE.exe'")
        If procs.Count > 0 Then
            Wscript.echo "Initiate Good Mood?"        
            os.run "DATA\Mekazoo.exe"
            WScript.Sleep 1000
            os.run "DATA\obsSTART.bat"
            WScript.Sleep 1000
            WScript.Quit
        Else
            WScript.Echo "Good Mood Initialization Had Failed! Please Close All Running Applications And Try Again"
            WScript.Quit
        End If
    Wend
    </script>
    </job>
    But when its hung and not responding to the task manager, the process XBCE.exe is still getting listed in Win32 Processes. The script believes all is good and initializes the stream, but XBCE wont show up on the recording because it has crashed and windows
    is waiting for me to wait or close.
    I have searched but to no avail have I found a way to check if the task manager thinks if XBCE is hung, then proceed to quit the script. That's all I really need. If its not hung proceed, if it's hung quit. Can someone please help?
    Edit
    I have updated the code above to reflect my current progress with this question and so you dont have to dig through my terrible formatting.

    I have a few questions that I haven't got the vocabulary to figure out I guess.
    -Is there anyway to automate changing the execution policy?
    I tried sending powershell two commands from a ps1. Set-ExecutionPolicy Restricted and Set-ExecutionPolicy Unrestricted. Obviously it blocks the script from running to change from restricted. So I either needed a way through the problem or around it. I could
    ask the person playtesting to Win+R powershell.exe and type Set-ExecutionPolicy to Unrestricted and then include a line in the script to change it back once everything has started. The problem with this is the user having to change the executionpolicy
    every time they try to play, and the biggest reason I dont like this is that the user has to mess with powershell at all. That was my way around the problem.
    My way through the problem was to find a way to bypass the execution policy. I tried running a few lines of code I picked up here in cmd as a batch file and a javascript file. The line I ran was:
    http://stackoverflow.com/questions/9271681/how-to-run-powershell-script-even-if-set-executionpolicy-is-banned
    powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File <C:\Users\Public\TESTPC-remote\switchrun.ps1>
    Batch through cmd gave me bad syntax, JS basically said the same thing and suggested adding semicolons to fix the problems.
    -What is the script syntax to start a diagnostic process and then check to see if its true?
    I can not figure out how to write the script to both start XBCE as a diagnostic process and then immediately after see if its responding. I can send the command to start but powershell doesnt move to the next line.
    $p=[System.Diagnostics.Process]::Start('C:\Users\Public\TESTPC-remote\XBCE.exe')
    While $p.Responding = True
    Invoke and start both cause powershell to stop..
    -Can I use this command and chain the start commands together?
    While writing the script I have now I thought about the possibility of running a program, check to see if responding equals true as a case to start the next program, or else stop the previous process and close the session. Here's my gibberish with that:
    $p=[System.Diagnostics.Process]::Start('C:\Users\Public\TESTPC-remote\XBCE.exe')
    While $p.Responding = True
    $p=[System.Diagnostics.Process]::Start('C:\Users\Public\TESTPC-remote\Mekazoo.exe')
    Else Stop-Process ('XBCE.exe')
    Exit-PSSession
    While $p.Responding = True
    $p=[System.Diagnostics.Process]::Start('C:\Users\Public\TESTPC-remote\OBS.exe')
    Else Stop-Process ('Mekazoo.exe', 'XBCE.exe')
    Exit-PSSession
    I have more questions but honestly with how many people have viewed my question vs answered it's clear I'm just an idiot and need to read more.. but Ill keep posting.
    Youneed to drop back andlearn a bit more about how software based systems wotj and how progrmming systems work.
    THe code you posted cannot funciton because it makes no technical sense.
    We cannot answer every little questionfor you. You need to spend time learning the basics and ask quesitons when a real issue confuses you.
    You cannot use a non-existent variable in a loop test becase it wil always evaluate to false and the loop will never execute.  This si programming 101.
    Execution policy IS automated via Group Policy. Please as you domain admmisn or Netowrk Admmin to explain the to you. 
    Your original question has been answered.  If you have another issue please open a new topic.
    ¯\_(ツ)_/¯

  • Export to excel with javascript/vbscript or with plsql(html table)

    i have searched for a way to export data from OracleXe to excel without losing formatting .
    So far i have found 2 possible relatively easy ways that i am still researching
    (i do not include the ask tom sylk format way of exporting )
    1 to export the query to a html table, while using stylesheets for formatting
    (using microsoft specific styles)
    2. use of javascript/vbscript to fill an array and write this array to excel with use
    of visual basic for applications in excel.This also provides charting capabilities.
    I am still researching this two ways, and have
    encountered a few obstacles (help would be appreciated)
    1 the first way:
    a. create a button " export to excel"
    b. create the following pl/sql procedure:
    owa_util.mime_header('application/vnd.ms-excel');
    owa_util.http_header_close;
      HTP.PRINT('<html>');
      HTP.PRINT('<head>');
      HTP.PRINT('<meta http-equiv="Content-Type" content="text/html">');
      HTP.PRINT('<title>Title of the HTML File</title>');
      HTP.PRINT('</head>');
      HTP.PRINT('<body TEXT="#000000" BGCOLOR="#FFFFFF">');
      HTP.PRINT('<h1>Heading in the HTML File</h1>');
      HTP.PRINT('<p>Some text in the HTML file.');
      HTP.PRINT('</body>');
      HTP.PRINT('</html>');
    htmldb_application.g_page_text_generated := true;
    htmldb_application.g_unrecoverable_error := true;
    c: run the procedure conditionally based on the button  "export to excel"
    the problem with this way is that using htmldb_application.g_unrecoverable_error := true; is not the ideal way, because it
    stops further processing, but if i leave it out, the export doesn't happen.
    To export to excel while retaining data formatting  you have to use microsoft excel
    specific styles(Seedocumentation on the microsoft site)
    2.The second way:
    a create a pl/sql procedure or sql query.
    b use this query to fill a vbscript/javascript array with values
    c write these values to excel with use of vba in excel :
    the obstacle i encountered here was that i dont know how to export the result of a
    query to a visual basic script or javascript array.

    Using approach 1) works fine for me.
    the problem with this way is that using htmldb_application.g_unrecoverable_error := true;
    is not the ideal way, because it
    stops further processing, but if i leave it out, the export doesn't happen. Why is this a problem?
    I created the button to export the excel file on page 1 and created your pl/sql procedure on page 2 using an onload process.
    Works fine.
    Other approaches for exporting to excel are:
    http://www.oracle.com/technology/pub/articles/saternos_broadcast.html
    http://htmldb.oracle.com/pls/otn/f?p=18326:54:5685133631021176591::::P54_ID:1962
    ~Dietmar.

  • Adobe VBScript or COM API fails when Adobe application not already open on a certain machine

    Was wondering if anybody might have input on this or observed this themselves. Is there a known issue/bug for this?
    I'm building scripted tooling to automate tasks in Adobe Illustrator and Photoshop, using the COM API (what Adobe lists as VBScript scripting reference, but is really COM). I've tested with both JScript (Microsoft Javascript, for doing same things you would use VBScript for) and Python using COM. In both cases got the same issue.
    When I was building the tooling, it works fine for me. But on a colleagues machine, the problem comes up. Sadly the error messaging is vague to pinpoint the root cause of the problem. We just know when it happens, but not why/how. We both have Windows 7 64-bit and are using 64-bit version of the Adobe apps, version CS6. Though we also have 32-bit version installed as well.
    The funny thing about my colleague's machine is the the tool/script will execute fine if Adobe Illustrator/Photoshop is already open. But if the app is not open already, it just fails at the point of instantiating the COM object. On my machine it works fine in both cases.
    Here's the error output observed:
    in JScript
    C:\scripts>cscript windows_cli_script_runner.js /s:C:\scripts\test.jsx
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.
    C:\scripts\windows_cli_script_runner.js(25, 5) (null): 0x800700C1
    in Python
    C:\scripts>python cli_script_runner.py -s C:\scripts\test.jsx
    cli_script_runner.py:33: SyntaxWarning: import * only allowed at module level
      def run_script(script,doc=None,app=None):
    Traceback (most recent call last):
      File "cli_script_runner.py", line 89, in <module>
        run_script(args.script)
      File "cli_script_runner.py", line 68, in run_script
        app_ref = win32com.client.Dispatch(app)
      File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
        dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
      File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName
        return (_GetGoodDispatch(IDispatch, clsctx), userName)
      File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch
        IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
    pywintypes.com_error: (-2147024703, 'OLE error 0x800700c1', None, None)
    C:\scripts>
    basically both point to this line at failure:
    in JScript
    var app_ref = new ActiveXObject(app);
    in Python
    app_ref = win32com.client.Dispatch(app)
    where app is "Illustrator.Application.CS6" or "Photoshop.Application", per the Adobe scripting guide and VBScript scripting reference.
    I didn't test VBScript but assume it's the same since JScript and VBScript and Python are all using same COM interface, and VBScript and JScript using same Windows Scripting Host interface.

    Also, there appears to be rather an unfortunate bug.  If the publisher does not yet have a subscriber, it looks like these two properties return an error.  Oof.
    So. there is this other way to do it.  Embarrassing.
    var allowAudio:Boolean = true;
    var allowVideo:Boolean = true;
    publishingStream.send("|RtmpSampleAccess", allowAudio, allowVideo);
    Yep.  The secret vertical bar call.  I believe you can make this call once on the publishing stream.  However, that'll only get to the subscribers that are currently connected and it won't get to subscribers that have yet to connect.
    You can also call send on the specific subscribing streams to give different permissions to each subscriber.
    More...
    http://forums.adobe.com/thread/632355?tstart=0

  • Extracting data from Excel To Illustrator javascript or vbscript

    Hi all-
    I was wondering if there was a way to extract data from Excel to be used in Illustrator. I know there is an option of variables and xml, and I don't want that. I've seen and tried out how to read illustrator and write to excel, and I get that.  What I would like to do is pretty much the opposite:
    1.Pre-fill in an Excel file(.xls,.csv, doesn't matter) with data such as a filename in column 1 and (Replacement Text) in column 2 and close manually.
    2. Run script(VBSCRIPT,Javascript, doesn't matter)
    3.For each column in Excel file where cell in first column is not empty, open Illustrator Template with placeholder of "DWG" textframe and replace the frame titled "DWG" with Replacement text from Excel in Column2.
    4, Save each to a PDF file and name file with text from Excel Column1(Filename)
    In a nutshell, there will be a single illustrator template with a premade textFrame with a name of "DWG". Excel will contain two columns, one for the filename to be named and one for the relative text to replace with the placeholder in AI. I hoped I explained this well enough without causing too much confusion. Thanks in advance.
    Filename
    Replacement Text
    test1.pdf
    DWG01
    test2.pdf
    DWG02
    test3.pdf
    DWG03
    test4.pdf
    DWG04

    As text… \n is new line character and \r is return character. I can't remember which excel uses but they both equate to a line/paragraph… I very quickly threw together an example for you…
    #target Illustrator
    textToPDF();
    function textToPDF() {
              if ( app.documents.length == 0 ) { return; }
              var doc, csvFile, i, fileArray, opts;
              csvFile = File( '~/Desktop/ScriptTest/Test.csv' );
              if ( !csvFile.exists ) { return; }
              fileArray = readInCSV( csvFile );
              doc = app.activeDocument;
              opts = new PDFSaveOptions();
              opts.pDFPreset = '[Press Quality]';
              // Here we loop the main array
              for ( i = 0; i < fileArray.length; i++ ) {
                        // Here we get the second item of sub array i
                        doc.textFrames.getByName( 'DWG' ).contents = fileArray[i].[1];
                        // Here we get the first item of sub array i
                        doc.saveAs( File( fileArray[i].[0] ), opts );
    function readInCSV( fileObj ) {
              var fileArray, thisLine, csvArray;
              fileArray =[];
              fileObj.open( 'r' );
              while( !fileObj.eof ) {
                        thisLine = fileObj.readln();
                        csvArray = thisLine.split( ',' );
                        fileArray.push( csvArray );
              fileObj.close();
              return fileArray;
    I haven't tested it but it should be close…?

Maybe you are looking for

  • How can I use LDAP searching from OSX Lion Server to Mozilla Thunderbird?

    How can I use LDAP searching from OSX Lion Server to Mozilla Thunderbird?  We have a super awesome contacts server that works great for our Mac users.  About 30% of our company are on PCs, and I would like to use the Mozilla Thunderbird mail client f

  • IPad 2 will no longer sync any movies from itunes

      None of the movies I purchaced in iTunes will sync to my iPad anymore.  When I click on the sync selected movies, then select any movie, then hit apply, the sync just ignores the fact that the movie is checked to sync.  No errors, just no movies on

  • Adobe reader opens "save as" box when clicking on save button rather than saving in the same file

    Hi everybody, I have a fillable PDF form designed in Livecycle designer and it is reader extended. When I fill that form on MAC it let me fill and save the form as many times as I like. Everytime I make any change I just click the save button it save

  • Custom tag attribute calculated by scriptlet expression

    Hi,           If I set the rtexprvalue subelement of the attribute element in my tld to           "true", should I be able to dynamically determine the value of my custom tag           attribute using a scriptlet expression?           When I include

  • Unable to+decode+or+import+selected+audio

    Looking for a solution.  I am running windows 7, adobe captivate 4.  I have attempted to convert text to speech, I get the error unable to+decode+or+import+selected+audio.  I have gone to the supplied library same error.  I have taken a mp3, changed