UCCX call in the script to disable all scripts in an emergency.

I work with UCCX 8.5 and I need to develop a script that the end user can call tones allows to disable the call center and send it to a message.  This way if anyone is able to do via the VPN or close a connection, they can call.  I already have a basic script writes the only problem is written and pulling from a file so text or xml.  Basically, when the user calls, they will be in a menu which will be asked if 1. call centers are closed and 2. What is the reason for the closure. Expect this can be bettr

Call answer

Quick-press 1 if call centres are closed and press 2, what they are open

1. write in a file "closed".

Then go to the closed guests

2. write in a file "open".

Then go to the end

Closed 1 guest-press for the closure of the weather, press 2, emergency closure, press 3 meets at closing

1. write in the file 'weather_closure '.

go to the end

2. write in the file 'emergency '.

etc, etc.

The daily script would check this file first if it is closed and if yes, then invites to play.

This is the file that I did so well. The script is easy.
Aid.

Hello

No, you don't have to use an XML.

The link I gave explains you how to use a simple text document.

I suppose you create a file with this content:

Open = 1

Name it something like "open_or_closed.properties".

Use this simple Java code to read the contents of the file. As prop.getProperty ("open"). Use an If not in UCCX script to check the value, if 1, then the call centre is open, if 0, closed.

G.

Tags: Cisco Support

Similar Questions

  • I made the mistake of disabling all my USB ports in Device Manager! Keyboard & mouse do not work. I need to restore the Sys - HELP!

    I made the mistake to disable all my USB ports in the device (Windows XP Home Edition) my mouse Manager and the keyboard works not because they are connected through USB ports. I need to find a way to get to the system restore through the Mode without failure or normal startup. Can someone please help!

    Hi PaulCanik,

    • Do you use your laptop or desktop computer?

    Check if keyboard works in basic input/output system (BIOS), if it works, then you will need to enable USB port from there.

    You will need to contact the manufacturer of the computer to aid in the basic input/output system (BIOS).

    If this does not help then you need to connect PS\2 mouse and activate later all USB ports on the computer.

    Important: Change (CMOS) BIOS/complementary metal oxide semiconductor settings can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the configuration of the BIOS/CMOS settings can be solved. Changes to settings are at your own risk.

  • Firefox plugin process takes all of the memory even if adobe flash is not installed and within the browser are disabled all java plugins is disabled. Why? NSA?

    Only a force quite, from the actual process of activity monitor, will do.

    Mac OS 10.6 Firefox stable and beta, oh, it lasts for months.

    Today is April 12, 2014

    Hello asthedogbarks, please create a new firefox profile and see if the problem exists.

    Thank you

  • How the script create\edit\save\load file?

    I can't find a tool or a command to create the script file in the powercli environment.

    How to create or load the script file?

    It is the simplest form simply the PowerCLI prompt and a text editor such as notepad for example.

    Once you have your script in a .ps1 file, you can call/run the script from the prompt PowerCLI.

    PS C:\Scripts >./myscript.ps1

    You will have to ensure that the performance of PowerShell policy is set correctly to be able to run scripts.

    The is easier to develop and run scripts using a graphical interface that allows you to edit and run the script in the same graphical interface.

    With PowerShell comes the ISE, which became pretty good in PS v3.

    And there are other GUIs as more than Idera PowerShell and PowerGui.

    One to use is a matter of personal preference

  • All of the controls display disabled if transformation dialog... WHY?

    Transform each.  A reasonably useful, if the minimalist dialog box disables all THE controls view.

    Including Zoom and pan.

    And of course the really useful things, like hiding boxes of delimitation and frames/edges and Guides... they also don't work.

    Why such a monochromatic and linear force in 2013?

    Adobe has spent NOT of its record profits hiring more programmers?

    Are their all scripts that move you this heinous oversight, the surplus of what... 1995?

    New: Here users can not tell you why. Illustrator is a very old and archaic program that did not follow over time. But you already know that.

    Or is there another explanation?

    There is further speculation. Mine is simply that the user base continues to tolerate. At the end of counts, that's why. If you want more explanation, read on:

    Adobe PostScript was created in the 1980s. Adobe has dominated the graphics industry since then. So people are buying Illustrator because it carries the Adobe brand. None of this has changed.

    It becomes a cycle of self-fullfilling. Newcomers buy Illustrator beginning - we're assuming that it is the "value" because it carries the Adobe brand. As a result, most Illustrator users have very little experience with any other mainstream 2D Bézier programs drawing, or not at all. Long-time Illustrator only users are becoming more acquired in its archaic interface and bulky and fearing having to apply that kind of effort in learning any other program. They - self-protection Tower - advise newcomers that it's the "professional" choice the 'value '.

    If the cycle is repeated.

    Illustrator users only together Illustrator features assume to be "cutting edge" for its category of software. Adobe marketing, of course, support this myth.

    And it follows an absurd comedy. Literal decades pass before Illustrator users realize that 'page 2' is not only possible but valuable in a drawing program. The year 2013 (and who knows how many others) comes and goes without Illustrator never acquire the most basic features of a good set of basic geometric shape tools direct. You discover this. But there is nothing new. This is the way it has always been.

    Adobe continues to market the archaic functional bases same with occasional changes than a façade of the skin of the user interface. A long feature taken granted in another Bézier drawing programs is only occasionally added and even in the case of wobbly way paralyzed by membership dedicated to an obsolete interface Foundation which Adobe does not dare to change fear that risk alienating existing users.

    The interface becomes more and more scattered, cluttered, redundant, incoherent and outdated despite its changing style façade. The confusion resulting complicated is seen by newcomers as "powerful" and "comprehensive" thinking that must be why he's so unintuitve. They come here to ask 'how' and become vested in the very esoteric learning curve.

    And the cycle repeats.

    Other suppliers try to capture or retain market share by emulating the interface schema more prevalent in the hope to facilitate the "passage" to their products. They focus more on reproducing the same features of old Illustrator on innovation, even when their interface foundations are higher. Diagram of the Illustrator interface becomes the de facto standard and overall software segment is stagnating in a never-ending cycle of 'me, too' offerings.

    Domination of the Illustrator has so effectively the entire segment in old for many decades of lethargy. Users become adicted to same old mediocrity.

    Meanwhile, other graphics in growth segments software walk on. Users of 3D modeling, for example, enjoy a multitude of patterns of interface different, each competition to ensure superior features and a superior user experience. The basis of the user assumes a position of versatility and adaptability and is less dogmatic defensive of a paticular software. Obtaining and maintaining the professional competence in several programs are considered the norm. And the category advances, become more powerful, even while becoming more affordable (growth).

    Energetic beginners devote their efforts to the development of the energy situation: platforms, scripting, data, games and mobile applications-based solutions. Open source innovates in terms of business model, if it is in terms of software functionality and provides powerful applications to nearly zero price.

    And everyone yawns during the debate of 2D drawing and "yesterday's news" appears in more archaic, more as its stagnation continues. And unfortunately continues to fail to reach its potential yet-to-be-understood.

    Finally, self-fullfilling cycles are broken. Thereafter. The last disturbance to this particular cycle comes from Adobe itself: it's the only legitimate rental license regime, which continues.

    It remains to be seen if this becomes also a trend with other software providers, or if it breaks the stranglehold of Adobe on the market. If tolerated by the user base, it becomes certainly more remunerative for the vendor (at least for a time) and who continues as customers become willingly taken trapped by dependency provider-specific. Which allows the seller to deliver a value less than the cost the same (or even less), while maintaining the same price (or even more). It is the dream of all software vendors.

    It's the dream of every situation of monopoly. It's the dream of every socialist. And it works (for once) if only enough customers are properly are suckered in there. But ultimately even walls of Berlin and long distance call rating programs down. The cost and pain of the end of the cycle of self-protection, self-perpetuating is directly proportional to how long his damage is allowed to continue. It is best to nip these cycles in the bud. But history shows that does not always happen.

    So there is no reason your "why": that's what customers buy, driven by what they buy.

    JET

  • My colleague and I are editing our first UCCX Call Center Script to include Spanish. Help

    My colleague and I are editing our Call Center the existing script maps. This is our first attempt to script UCCX. They need to break the script in 2 locations, one that already exists for English and a copy of the menu for a Spanish version.  We have tried to include an option for Spanish 2.  We did not want to press 1 for English user, but can if necessary. English is supposed to drop through the menu new or existing. 2 for Spanish is doing nothing.  It acts as if you press anything even if we have an entry identified as Language_Choice and a filter of 2, for the appellant to the Enter key.

    We are short of time and could use some guidance.  Thanks for any help, Jackie

    Hello Jackie,.

    I have attached the sample script for your reference.

    Hop, it will work for you. :)

    Ravi

  • Block calls with the Expressway CPL script custom field empty

    We currently have a CPL script in place on our highway E we use to restrict access to certain devices.  We found that we had a call from h323 come in which the field is empty, it is somehow making it through scripting and is able to call anything.  Here are our current config:

    -

    -

    -

    -

    http://www.w3.org/2001/XMLSchema-instance"xmlns:taa ="http://www.tandberg.net/cpl-extensions">."



    -

    -

    -

    We tried to change the rules where the origin is empty, or just simply have a *, but it doesn't seem to work.  Anyone have ideas on how to match a call when the field is empty?

    Thanks in advance!

    I get the these calls all the time. the CPL script that I use to block is attached.

    Question of the use of the good source and destination, for example in the attached CPL, I use:

  • Ignore all the lines in the Script of Import FDMEE

    Hi all

    I created a script to import such as to one of the custom, the value must be the name of the location. But this isn't getting this value and also skip all lines and newspaper it shows like Script jumps for all lines. Please indicate why this is happening.

    ************

    def Parse_Entity (strfield, strrecord):

    org = fdmContext ["LOCNAME"]

    back org

    *****************

    2015-06-02 06:20:09, INFO 724 [AIF]: ERPI - 105011:EPMERPI - JythonInterpreter instantiation

    2015-06-02 06:20:10, 110 [AIF] INFO: 105039:EPMERPI - the name of the log file: D:\Oracle\FDMAPPS\outbox\logs\SAHFM_141.log

    2015-06-02 06:20:10, 112 [AIF] DEBUG: ERPI - 105011:EPMERPI - script file of passage for the execution of the jython interpreter: D:\Oracle\FDMAPPS/data/scripts/import/Test.py

    2015-06-02 06:20:10, 114 [AIF] INFO: 105039:EPMERPI - run the file: D:\Oracle\FDMAPPS/data/scripts/import/Test.py

    2015-06-02 06:20:10, 116 [AIF] DEBUG: 105039:EPMERPI - LOG_LEVEL: 5

    2015-06-02 06:20:10, 116 [AIF] DEBUG: 105039:EPMERPI - Script to the file encoding: UTF-8

    2015-06-02 06:20:10, 117 [AIF] DEBUG: 105039:EPMERPI - def Parse_Entity (strfield, strrecord):

    org = fdmContext ["LOCNAME"]

    back org

    2015-06-02 06:20:10, 131 [AIF] DEBUG: ERPI - 105011:EPMERPI - compilation script: Test(strField,strRecord)

    2015-06-02 06:20:10, 135 [AIF] INFO: ERPI - Testing.txt name for the 105011:EPMERPI file.

    periodKey2014-11-30

    2015-06-02 06:20:10, 137 [AIF] DEBUG: ERPI - 105011:EPMERPI - error assess scriptnullorg.python.core.PyException.fillInStackTrace(PyException.java:70)

    java.lang.Throwable. < init > (Throwable.java:181)

    java.lang.Exception. < init > (Exception.java:29)

    java.lang.RuntimeException. < init > (RuntimeException.java:32)

    org.python.core.PyException. < init > (PyException.java:46)

    org.python.core.PyException. < init > (PyException.java:43)

    org.python.core.PyException. < init > (PyException.java:61)

    org.python.core.Py.NameError(Py.java:220)

    org.python.core.PyFrame.getname(PyFrame.java:276)

    org. $0 Python.pycode._pyx955.f (< script >: 1).

    org. Python.pycode._pyx955.call_function (< script >)

    org.python.core.PyTableCode.call(PyTableCode.java:165)

    org.python.core.PyCode.call(PyCode.java:18)

    org.python.core.Py.runCode(Py.java:1204)

    org. Python.Core.__builtin__. Eval (__builtin__. Java:504)

    org.python.util.PythonInterpreter.eval(PythonInterpreter.java:164)

    com.hyperion.aif.file.common.util.DataLoadEngine$ Expression.evaluateScript (DataLoadEngine.java:1031)

    com.hyperion.aif.file.common.util.DataLoadEngine$ Expression.access$ 200 (DataLoadEngine.java:924)

    com.hyperion.aif.file.common.util.DataLoadEngine$ ImportItemFileEntity.evaluateExpressions (DataLoadEngine.java:834)

    com.hyperion.aif.file.common.util.DataLoadEngine.processFileRow(DataLoadEngine.java:656)

    com.hyperion.aif.file.common.util.DataLoadEngine.loadRow(DataLoadEngine.java:385)

    com.hyperion.aif.file.data.ImportTextData.performLoad(ImportTextData.java:374)

    sun.reflect.GeneratedMethodAccessor795.invoke (unknown Source)

    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    java.lang.reflect.Method.invoke(Method.java:597)

    org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:175)

    org.python.core.PyObject.__call__(PyObject.java:355)

    org.python.core.PyMethod.__call__(PyMethod.java:215)

    org.python.core.PyMethod.instancemethod___call__(PyMethod.java:221)

    org.python.core.PyMethod.__call__(PyMethod.java:206)

    org.python.core.PyObject.__call__(PyObject.java:381)

    org.python.core.PyObject.__call__(PyObject.java:385)

    org. $2 Python.pycode._pyx941.importData (< string >: 91)

    org. Python.pycode._pyx941.call_function (< string >)

    org.python.core.PyTableCode.call(PyTableCode.java:165)

    org.python.core.PyBaseCode.call(PyBaseCode.java:297)

    org.python.core.PyBaseCode.call(PyBaseCode.java:191)

    org.python.core.PyFunction.__call__(PyFunction.java:385)

    org.python.core.PyMethod.__call__(PyMethod.java:215)

    org.python.core.PyMethod.instancemethod___call__(PyMethod.java:221)

    org.python.core.PyMethod.__call__(PyMethod.java:206)

    org.python.core.PyObject.__call__(PyObject.java:432)

    org.python.core.PyObject.__call__(PyObject.java:436)

    org. $0 Python.pycode._pyx944.f (< string >: 5)

    org. Python.pycode._pyx944.call_function (< string >)

    org.python.core.PyTableCode.call(PyTableCode.java:165)

    org.python.core.PyCode.call(PyCode.java:18)

    org.python.core.Py.runCode(Py.java:1204)

    org.python.core.Py.exec (Py.java:1248

    ***********************

    [WHITE]

    [WHITE]

    [SCRIPT SKIPED] Opening balance of the CAC Description debits credits closing balance

    [SKIPED FROM SCRIPT ] --------------- ------------------------------- -------------------- -------------------- -------------------- --------------------

    [SCRIPT SKIPED] 1010 CASH IN BANKS 84 410,91 33,419,258.45 35,189,715.65-1,686,046.29

    1050 [SCRIPT SKIPED] CASH EQUIVALENTS 320,422,492.02 181,734,281.41 222,421,493.83 279,735,279.60

    [SCRIPT SKIPED] 1059 RESTRICTED CASH 920,357.21 0.00 0.00 920,357.21

    Filled lines: 0

    Lines rejected: 19

    **********************

    Your import script file name and the name of the defined function must be the same, that is to say that your function is called Parse_Entity the import script should be called Parse_Entity.py not Test.py in your error log indicates have called it

  • Call via the FDM script batch file

    Hi all

    Here is the FDM script written to call the command via the Script FDM in import file, test the operation of the script by creating a vbscript file (* .vbs) to call the batch file and worked like charm. Please see the excerpt from the sciprt

    SubMonth = "Mar".

    SubYear = "FY15.

    ARG = trim (SubYear) & "" & trim (SubMonth)

    Set objWshShell = CreateObject ("Wscript.Shell")

    strCmd = "E:\hyperionfiles\batch\CalcActNew.bat" & Arg

    Line 53 objWshShell.Run 'strCmd', 0, True

    The error returned is

    Error.JPG

    Thank you

    Hi, no double quotes are needed to join strCmd it's a variable

    objWshShell.Run strCmd, 0, True

  • How to call the script shell of the Hyperion Workspace

    Hi all

    I have to call a shell script of the Hyperion workspace. After searching on Google, I came to know that its possible using generic employment applications.

    So I created a generic job application in the workspace to help below in detail.

    Job name: set_run_shell

    Server: Name of the Server workspace

    Order tempate: $PROGRAM $PARAMS

    executable: Cygwin executable path (like hyperion installed in windows server 2008, I had to install Cygwin to make the unix-like environment)

    Just write simple shellscript that the ECHO command displays "Hello World."

    Imported this shell script and above assigned jobs for it but no luck, when I run this job I never see output or less error. It showing the message running for a long time until get session expires.

    Can someone help me to run a shell script.

    Thank you

    Aravind

    The executable file must be %WINDIR%\System32\cmd.exe cmd.exe

    You will also need to create a batch file that comes from this sh.exe and imports that work. Try and let me know.

    Concerning

    Celvin Kattookaran

  • All files generated by a coil in sqlplus receive ownership of oracle: dba instead of the user of the BONE started sqlplus and run the script. There's a file with users owners of BONES of the coil.

    All files generated by a coil in sqlplus receive ownership of oracle: dba instead of the user of the BONE started sqlplus and run the script. There's a file with users owners of BONES of the coil.

    Script launched in until OS user 'A' on the 'A' server which launches sqlplus, then connects to a remote database through a service of tnsnames.ora as another user of the database and the results of this script are spoulées on the server "A".

    The file queued on the old server is written with rw-rw-r: read write user, group read the writing, reading and possession header that is the user of the OS. The file queued on the new server is written to rw-r-r user: reading writing, reading group, public reading and ownership oracle: dba.

    "" The user then has no privileges to modify the file and continue the process of transmitting the file, editing and deleting the file for the next set of commands. This allows us to keep the possibility to migrate to the new server we are unable to process orders.

    $ORACLE_HOME/bin/sqlplus - s user/password@prd1 @./script/CustomScript/R12_OM_UFPC-oracle.sql

    Background: old server running 4.8, Oracle 10.2.0.4 OEL

    New server running OEL 6.5, Oracle 11.2.0.4

    Tested so far:

    File and update umask to 0002 instead of 0022 is now generated as rw-r-r. However, the property is still oracle: dba.

    Update of ownershipt of $ORACLE_HOME/bin/oracle.exe of oracle: oracle (edi added the user to the oracle group) and chmod 6751 oracle.exe. This created several problems where crucial scripts, that is to say of sqlplus failed to run.

    Added! chmod 755 output.file.name - OS user 'A' is not allowed to change to mod.

    Added! command cp MV output file and that generated the file as a user of the operating system: oracle. It is a potential work around in case of emergency, but the developer would have to rewrite the countless scripts.

    Any ideas?

    I have reproduced the behavior of the old server and am able to spool a file via sqlplus under OS user. No changes have been made on the remote database server. All the changes have been on the new server hosting a small 11.2.0.4 database on a server running OEL 6.5 32 - bit OS.

    (1) removed the sticky bit $ORACLE_HOME/bin/sqlplus using chmod u-s, g-s, o - s suggestion of Billy ~ Verreynne

    (2) modified the main group for the 'oracle' user match the user operating system applications, while maintaining membership in the groups 'oracle' and 'dba '.

    -We are dealing with here EDI processes, so the Group was called edi.

    (3) modified property of the files tnsnames.ora and listener.ora for oracle: edi

    (4) restart the receiver

    (5) disconnect / reconnect

    Script runs as expected, the output file contains the correct ownership and permissions.

    Thank you all for taking a look and offering options.

    -Josh

  • How the photoshop script can call an applescript script

    I realize, maybe it's a bit of a messy way around it, but I need to get the photoshop script to call an applescript script. Basically so that I can have it become a menu item in photoshop.

    Is - this show applescript can in the same way photoshop script?

    If this isn't the case, I thought I could get either photoshop script to call the applescript or even more messy, I could use Photoshop to run a Terminal command to call the applescript.

    All thoughts

    Matt

    For those who come through it

    Save your applescript as an application, and then you can use

    App.System ("' open ' / path/to/script_as_an_app.app'" ");

    then everything works

  • Captivate 8 cannot remove the background of the play bar after the script is disabled

    Hi all

    I'm not sure what I'm doing wrong.  I chose the play bar to be disabled for the project in the skin Editor, I have scripted the PlayBar is disabled on the slide.  The play bar is not displayed but leaves behind an ugly grey section below my slides.  I know that I can change the background color of the play bar, but I don't want a list of the PlayBar.

    Any suggestions would be greatly appreciated

    Thanks in advance

    Richard

    Here you go... In the skin Editor, clear the Show borders check box. This screenshot shows that it selected.

    Anthony

  • Disable all of the traffic on the HBA

    Hi all

    I have to completely disable all of the traffic to an HBA on my 20 ESXi servers. I have a list of WWN that should be blocked. My IBM servers each has 4 cards HBAS (Qlogic ISP2432) with interfaces 2fc on each, so infact I have a disable for specific with two HBAS paths but I have no idea how.

    Thanks in advance for any help

    Visit my blog

    www.vmwaremine.com

    OK, I think I see what you mean.

    You want to offer the WWN of the HBA (s), and then clear all paths of the LUN running on this HBA.

    First of all, this little script will list the device and the WWN for all CF cards.

    $esxName = 
    
    $esx = Get-VMHost -Name $esxName | Get-View
    
    $report = @()
    
    $esx.Config.StorageDevice.HostBusAdapter | where{$_.GetType().Name -eq "HostFibreChannelHba"} | %{
         $row = "" | Select Device, WWN
         $row.Device = $_.Device
         $row.WWN = "{0:x}" -f $_.PortWorldWideName
         $report += $row
    }
    $report
    

    With this report, you should be able to extract values WWN, you need.

    The following script then disables all paths that cross this HBA adapter.

    $esxName = 
    
    $tgtPaths = @("2100001b2312ac9e","2101001b2312ac9e")
    
    $esx = Get-VMHost -Name $esxName | Get-View
    $hstorMgmt = Get-View $esx.ConfigManager.StorageSystem
    
    $hbaKeys = @()
    # Get the key(s) of the HBA(s)
    $esx.Config.StorageDevice.HostBusAdapter | where{$_.GetType().Name -eq "HostFibreChannelHba"} | %{
         $WWN = "{0:x}" -f $_.PortWorldWideName
         if($tgtPaths -contains $WWN){
              $hbaKeys += $_.Key
         }
    }
    
    # Disbale all paths that run through the HBA(s)
    foreach($lun in $esx.Config.StorageDevice.MultipathInfo.Lun){
         foreach($path in $lun.Path){
              if($hbaKeys -contains $path.Adapter){
                   $hstorMgmt.DisableMultipathPath($path.Name)
              }
         }
    }
    

    I hope that it resembles more what you wanted to do?

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • ExtendToolscript opens when I call the script from photoshop

    Hey,.

    I asked this question on in general discussions by mistake if I though I would ask new here.

    I have a Javascript that I wrote which generates an interface of buttons in groups organized according to the contents of some folders. Everything works fine, but when you call it from photoshop and extendtoolscript it is not always executed it opens. I wrote many scripts with interfaces and I've never had this problem. This isn't a huge problem for me, as I usually have this program open anyway, but I intend to have a team of people using this script, so if I could stop, somehow, it would be much better.

    If anyone has experienced this before? Or maybe functions extendscript causes to open?

    I don't see anything unusual in the script...

    Any help would be appreciated!

    Thank you

    Mark

    var strtRulerUnits = app.preferences.rulerUnits;
    var strtTypeUnits = app.preferences.typeUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    app.preferences.typeUnits = TypeUnits.PIXELS;
    
    
    
    
    var templatepath = "~/Desktop/BANNERS/";
    
    
    var bannerfile = ""
    var docRef = app.activeDocument;
    
    
    
    
    var fileArray = new Array();
    
    
                    var sourceFolder = Folder (templatepath + "MAIN/");
    
    
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
    
    
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArray.push(doc);
                                                    }
                                    }
                    }
                
                
                var w = new Window ("dialog", "Choose a Banner");
                w.preferredSize = [400, 100];
                w.orientation = 'row';
                w.alignChildren = "left"
                w.alignChildren = [ "fill", "fill"];
                
                w.btnPnl = w.add('panel', undefined, 'MAIN');
                
                w.btnPnl.btn = w.add ("group");
                w.btnPnl.btn.alignChildren = "left"
                
                var buttonarray = new Array ();
                var key = {};
                
                
                
                for (var i = 0; i < fileArray.length ; i++) {
                    
                    var delimeter = '/';
                    var string = String (fileArray[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    
                    
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    }
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    }
                    var counter = (counter + 1);
                    }
                
                    }
                if (fileArray.length > 6){
                        var divider = 2
                        }
                    else{
                        var divider = 1
                        }
                    
                    var remainder = (i % divider);
                    if (remainder == 0){  
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    }
                    
                    key = (String (fileArray[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername ); 
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    
                    function button_pressed (e)
                    {
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    ////////////////////
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    }
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    }
                    var counter = (counter + 1);
                    }
                }
                
                    ///////////////////////
                    
                    bannerfile = new File (templatepath + "MAIN/" + buttonname + '.png');
                    
                     }
                 }
             
     ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
    
    var fileArrayneon = new Array();
    
    
                    var sourceFolder = Folder (templatepath + "NEON/");
    
    
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
    
    
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArrayneon.push(doc);
                                                    }
                                    }
                    }
                
                
                
                
                w.btnPnl = w.add('panel', undefined, 'NEON');
                
                w.btnPnl.btn = w.add ("group");
                
                var buttonarray = new Array ();
                var key = {};
                
                
                
                for (var i = 0; i < fileArrayneon.length ; i++) {
                    
                    var delimeter = '/';
                    var string = String (fileArrayneon[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    
                    
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    }
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    }
                    var counter = (counter + 1);
                    }
                
                    }
                
                if (fileArrayneon.length > 6){
                        var divider = 2
                        }
                    else{
                        var divider = 1
                        }
                    
                    var remainder = (i % divider);
                    if (remainder == 0){  
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    }
                    
                    key = (String (fileArrayneon[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername ); 
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    
                    function button_pressed (e)
                    {
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    ////////////////////
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    }
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    }
                    var counter = (counter + 1);
                    }
                }
                
                    ///////////////////////
                    
                    bannerfile = new File (templatepath + "NEON/" + buttonname + '.png');
                    
                     }
                 } 
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
    var fileArray180 = new Array();
    
    
                    var sourceFolder = Folder (templatepath + "180/");
    
    
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
    
    
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArray180.push(doc);
                                                    }
                                    }
                    }
                
                
                
                
                w.btnPnl = w.add('panel', undefined, '180');
                
                w.btnPnl.btn = w.add ("group");
                
                var buttonarray = new Array ();
                var key = {};
                
                
                
                for (var i = 0; i < fileArray180.length ; i++) {
                    
                    var delimeter = '/';
                    var string = String (fileArray180[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    
                    
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    }
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    }
                    var counter = (counter + 1);
                    }
                
                    }
                        
                   if (fileArray180.length > 6){
                        var divider = 2
                        }
                    else{
                        var divider = 1
                        }
                    
                    var remainder = (i % divider);
                    
                    
                    if (remainder == 0){  
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    }
                    
                    key = (String (fileArray180[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername ); 
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    
                    function button_pressed (e)
                    {
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    ////////////////////
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    }
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    }
                    var counter = (counter + 1);
                    }
                }
                
                    ///////////////////////
                    
                    bannerfile = new File (templatepath + "180/" + buttonname + '.png');
                    
                     }
                 }   
      
    
    
    
     ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
    
    
    var fileArraymisc = new Array();
    
    
                    var sourceFolder = Folder (templatepath + "MISC/");
    
    
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
    
    
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArraymisc.push(doc);
                                                    }
                                    }
                    }
                
                
                
                
                w.btnPnl = w.add('panel', undefined, 'MISC');
                
                w.btnPnl.btn = w.add ("group");
                
                var buttonarray = new Array ();
                var key = {};
                
                
                
                for (var i = 0; i < fileArraymisc.length ; i++) {
                    
                    var delimeter = '/';
                    var string = String (fileArraymisc[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    
                    
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    }
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    }
                    var counter = (counter + 1);
                    }
                
                    }
                    if (fileArraymisc.length > 6){
                        var divider = 2
                        }
                    else{
                        var divider = 1
                        }
                    
                    var remainder = (i % divider);
                    if (remainder == 0){  
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    }
                    
                    key = (String (fileArraymisc[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername ); 
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    
                    function button_pressed (e)
                    {
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    ////////////////////
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                        
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");    
                    }
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    }
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    }
                    var counter = (counter + 1);
                    }
                }
                
                    ///////////////////////
                    
                    bannerfile = new File (templatepath + "MISC/" + buttonname + '.png');
                    
                     }
                 }  
    
    
    
    
    
       
                     
     w.show();
    
    
    
    
    
    
    
    
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
    
     if (bannerfile == ""){}
     else{
    
    var targetDocumentName =  docRef.name;
    var tempfile = app.open (bannerfile);
    var sourceDocumentName = app.activeDocument.name;
    
    
    
    
    var thewidth = tempfile.width;
    var theheight  = tempfile.height;
    
    
    
    
    app.activeDocument = docRef;
    docRef.resizeImage (null, theheight, null, ResampleMethod.BICUBIC);
    
    
    if ((String(thewidth)) == (String(docRef.width))){
    var thelayer = docRef.activeLayer;
    copyLayers(sourceDocumentName, targetDocumentName );
    docRef.activeLayer = thelayer;
    }
    else {
    alert ("Document width Incorrect")   
    
    
    docRef.activeLayer.name = "main";
    var thelayer = docRef.activeLayer;
    docRef.resizeCanvas (thewidth, null, AnchorPosition.BOTTOMCENTER);
    copyLayers(sourceDocumentName, targetDocumentName );
    docRef.activeLayer = thelayer;
     }
      imageView ("FtOn");
     }
    
    
    
    
    
    
    
    
    
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////
    
    
    
    
     function copyLayers(sourceDocumentName, targetDocumentName) {
      var sourceDoc = app.documents[sourceDocumentName];
      var targetDoc = app.documents[targetDocumentName];
      var sourceLayer, targetLayer, sourceGroup;
    
    
      if (app.activeDocument != sourceDoc) {
        app.activeDocument = sourceDoc;
      }
    
    
    var thelayer = tempfile.layers[0];
    var layersToCopy = thelayer.name;
    
    
      if ( typeof layersToCopy === 'string' ) {
        sourceGroup = tempfile.layers[0];
        targetLayer = sourceGroup.duplicate( targetDoc, ElementPlacement.PLACEATBEGINNING )
      }
      else if ( Object.prototype.toString.call( layersToCopy ) === '[object Array]' ) {
        for (var i = 0; i < layersToCopy.length; i++) {
          sourceLayer = sourceDoc.artLayers.getByName( layersToCopy[i] );
          targetLayer = sourceLayer.duplicate( targetDoc, ElementPlacement.PLACEATBEGINNING );
        }
      } 
    tempfile.close(SaveOptions.DONOTSAVECHANGES);
    }
    
    
    
    
    
    
    function imageView (view) {
        desc= new ActionDescriptor();
            ref = new ActionReference();
          if (view.length < 5){
             var viewID = charIDToTypeID( view );
          }else{
             var viewID = stringIDToTypeID( view );
          }
          ref.putEnumerated( charIDToTypeID( "Mn  " ), charIDToTypeID( "MnIt" ), viewID );
        desc.putReference( charIDToTypeID( "null" ), ref );
       executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
    };
    
    

    $.writeln (written) the text specified in the JavaScript Console to ExtendScript Toolkit.

    You will probably need to 4 occurrences of the following line, apparently used for purposes of debugging in comment:

    $.writeln (e.target.text + " from panel " + e.target.parent.text);

Maybe you are looking for