Close() in function using ScriptUI.

Guys, I created an interface with ScriptUI only has a IconButton within a group, which in turn is located in another group. I also created a listener to see who you press on " on the keyboard, which performs a function where there is a condition that must close the interface If the key is pressed " "" Enter. " However there is a error on line # 23, I am unable to define the correct path ... I'm not even embarrassed ask, but I'm more than an hour by train and I can't not solve this problem. Le onClick event online # ' 12 runs correctly so groups using the " ""parent", but how do I need to walk the line like # 23?


Thank you very

//
dialogo();
function dialogo(){
            var janela = new Window ("dialog");
            //     
                        var grupoDaDireita = janela.add ("group");
                        //
                                    var grupo4Dir = grupoDaDireita.add ("group");
                                    //
                                    var btnOK = File (Folder(File($.fileName).parent).fullName+"/"+"ok_btn.png")
                                    var eventoOk = grupo4Dir.add ("iconbutton", undefined, btnOK, {style: "toolbutton"});
                                    eventoOk.onClick = function (){this.parent.parent.parent.close();};
                                    //
                        //
            //
            janela.addEventListener ("keydown", function (k) {verificaKeyboard(k);});
            janela.show ();
}
//
function verificaKeyboard(k){
            alert(k.keyName);
            if(k.keyName == "Enter"){
                        janela.close();
            }
}
//

Hello

Move your verificaKeyboard() function in the body of the dialogo() function

variable "Alana" is local and is not accessible.

Jarek

Tags: InDesign

Similar Questions

  • Easy way to locate the function used on the diagram by name?

    Is there an easy way to locate the functions used in the diagram under the name of the generic function?

    I have user appears somewhat to the user on my diagram functions to help me debug a difficult sequence of agross events live multiple now that it works, I want to go back and disable most of these postings. Most of them went up to now within the layers a little structure and is not easy to find.

    So is there an easy way to get a list of where these functions are used so that I can quickly go and edit them?

    I find the function is with the display hierarchy that does just what I need.

    Thank you.

  • Dockable panels using ScriptUI

    Hello

    Can someone tell me if its possible to create using ScriptUI panels which are dockable?

    I created using panels of HTML5, that work OK, but I was wondering if there was a built-in way to do this with your stay in ESTK environment?

    See you soon

    Roy

    No, this is not possible.

    P.

  • Can I call a function using the array index?

    I defined a table that stores the name of the function, like this:

    var aresetButtonTop:Array = new Array(resetTop1,resetTop2,resetTop3,resetTop4,resetTop5);

    Then I have a button named "btnresetTop" which, once clicked will be called one of the five functions stored in the array (aresetButtonTop) above. Functions are called at runtime depending on certain conditions. I need to figure out how I can call these functions using the array index. I use the following code to call the function. The value of i has already been calculated.


    btnresetTop.addEventListener (MouseEvent.CLICK, aresetButtonTop [i]);

    After doing this, I get the following error when I click on the button:

    TypeError: Error #2007: parameter listener must be non-null.
    at flash.events::EventDispatcher/addEventListener()
    at gallerytest_fla::MainTimeline/thumbTopClick()

    Note: thumbTopClick() is a function within which all these codes are written.

    I need to know if it is posible in AS3 to call a function name using array index or not. If so, could you afford ehelp me out.

    You can certainly do.

    In your case, it looks like i is out of range. Show your loop.

  • Can a DB function used between 2 pools of connections

    Hi all
    We have 2 pools of connections, 1 connected to Oracle DB Data Warehouse. The other connection pool is an Excel spreadsheet, which has projects and scheduling dates. We have modelled in MDB and her servant perfectly. Now, the question is, we have a function in Oracle DB, which works well when I use with any size of Oracle DB DW. But, when I use the same function using the dimension modeled of excel sheet it generates an error. Here, dimension sheet Excel is modeled to inculde model DW.

    Error: "A general error has occurred. [nQSError: 42015] Cannot function ship the following expression. »

    So my question is "is there no work around to use the same function when using the other connection pool size.

    Pointers for this problem is highly appreciated.

    Thank you
    Vijay

    Hi Vijay,

    I agree 100% with what Dave. The function you have in Oracle should have access to the values passed in. OBIEE has access to both DIM_DW and DIM_EXCEL, but the Oracle function has no access to DIM_EXCEL. Just to give you a high level understanding of what is happen, here's what OBIEE made to combine the two sets of data in a single report:

    Assume that your report is like so: DIM_DW. COLUMN1, DIM_EXCEL. COLUMN2, FACT_DW. MEASURE1

    To get the data OBIEE sends two separate applications: one against the DW that retrieves DIM_DW. Column1 and FACT_DW. MEASURE1 and another for DIM_EXCEL. COLUMN2.

    Once the two request to return, the OBIEE server joined data sets and then presents them in a report.

    Now, when you call your function (DIM_DW. COLUMN1, DIM_EXCEL. COLUMN2), OBIEE sends the request to just the Oracle DB. But the Oracle DB can not see the Excel data, then it fails because the DIM_EXCEL argument. Column2 is not defined to Oracle DB.

    Here are two methods you could use to make it work:
    (1) configure the Excel file as an external table in the Oracle DB. Then, the function would be aware of the values of column in Excel.
    (2) port the function to the MDB using layer logic the formula Expression. According to what is your function, it is not possible.

    Whatever it is, how you install now, you can't reach your goal. The reason why I recommended that you separate your connection pool Excel in a different database object is because the way you have it setup right now makes it appear like the Oracle DB would be aware of the Excel tables. But that's not true. Keeping them separated to avoid any future confusion.

    Good luck!

    -Joe

  • Problem with SaveAs function using random paths.

    The installation program:

    Part 1) I have a script to the folder level that allows me to exercise a SaveAs function within forms. I'm doing this as a way to save the document quietly in the background. The effect is that the file is replaced with a copy of itself. The script is:

    var mySaveAs = app.trustedFunction (function (oDoc, cPath, cFlName)

    {

    app.beginPriv ();

    cPath = cPath.replace(/([^\/])$ /, ' $1 / ');

    try {}

    oDoc.saveAs (cPath + cFlName);

    } catch (e) {}

    App.Alert ("error during save it");

    }

    app.endPriv ();

    });

    Part 2) of my documents, I have to check by calling the function below:

    function runSave()

    {if (typeof (mySaveAs) == 'function') {}

    var pathArray = this.path.split("/"); "

    var myFileName = pathArray [pathArray.length - 1];

    cPath var = this.path.slice(0,myFileName);

    mySaveAs (this, cPath, myFileName);

    } else {}

    App.Alert ("Missing Save Function\n" + "Please contact forms administrator");

    }

    }

    Part 3) I have several large forms that use automatic recording to call save work according to a time interval of 5 minutes, using:

    app.setInterval (runSave (), 300000);

    The problem:

    Part 1) automatic backup function works very well and it works silently in the background. However, I started having problems when I open two forms at the same time. If, for example, I have a form of an open folder and open a form from a second folder, the save feature will sometimes save the active document in its original folder (as expected, crashing and creating an automatic registration) or sometimes save to original folder of the second document. This leaves me a copy update (automatic check) of the document in the right folder, and a copy not updated in the original folder. This seems to vary on what document I opened finally or document that is currently active. Although I can't find the right combination.

    It's like thinking what is to confuse the "this.path.

    Part 2) worse, if two documents have the same name, as is often the case with these forms, any incorrect saving deposit causes a crash of the second document and data loss.

    Part 3) makes it maddening, as sometimes happens when no record or the second second document is open. Instead, damaging it saves the active document in a recently viewed folder. For example, I'm going to open a local folder and open a Word doc, close the file and the doc, go to another folder in a different root (a folder in network), open the form and automatically saves it on the local computer in the folder with the Word doc. So now not only do I have a copy not updated in my folder, I have no idea where the updated copy was actually saved to until I met some time later.

    Part 4) once again, worse still, the previously viewed folder could happen which contains a document with the same name, and that the document is crushed by the automatic backup. I have no idea that the form was crushed until I sometimes open a little later and see that it contains a completely different form data.

    What is happening and how it stop?

    Adobe Acrobat X Pro on a PC.

    The code for this tutorial is unfortunately wasn't working, I discovered recently.

    This is my own personal code for a trust saveAs method. Note that it takes 2 parameters, not 3.

    safeSaveAs = {app.trustPropagatorFunction (function (doc, vPath)}

    app.beginPriv ();

    doc.saveAs({cPath:vPath});)

    app.endPriv ();

    });

    myTrustedSaveAs = {app.trustedFunction (function (doc, vPath)}

    app.beginPriv ();

    safeSaveAs (doc, vPath);

    app.endPriv ();

    });

    You call it like this:

    myTrustedSaveAs (this, "/ c/temp/test.pdf");

  • How can I create a function using variables TestStand and call from Meadow step Expression?

    In one sequence, I have dozens of prior Expressions, which are almost the same thing, like this...

    Locals.tagID = (Parameters.singlePhaseEnabled? ('L': "D") & Str (Locals.phase) & "006".

    .. and the only thing different is this three-digit string in the end ("006" may vary). How can I write a function that I can call from Meadow step Expression then it should look like this? ...

    Locals.tagID = MyNewFunction("006")

    You can not write custom expressions for commands.

    That being said, there are two options:

    • Create a sous-suite with a single step. Use a setting of the sequence as "function parameter.

    • Create a step type custom including a lower level module that implements the function. Add a step edit to allow the user to the steptype graciously change the setting.

    • Store the variable setting in a local global variable / file and change the value in each step. This will, at least, keep the same 'function' for each step.

    Norbert

  • How can I close a window using the keyboard? I ' v tried ctrl w. How can I maximize a page?

    my mouse is broken and I don't know how to maximize my window without pressing f11. If I can not close it by pressing ctrl w and then how to close a window or how to the address bar or the top bar which reduce it, restore and close buttons?

    To close a window: make sure that the window is enabled (hold the ALT key, then press the TAB key repeatedly until the window you want is selected). Then (once the window is activated), hold down the ALT key and press/release the button F4.

    Another method: make sure that the window is enabled (hold the ALT key, then press the TAB key repeatedly until the window you want is selected). Then (once the window is selected, press ALT and the SPACEBAR. The menu of the selected window 'system' opens. From there, you can use the up/minimize the arrows on your keyboard to select/highlight, maximize or close. Once your choice is highlighted, press ENTER.

  • Media Center does not close when you use my administrator account

    When I connect account administrator w / my, media library opens on its own. I then close media library but whenever I try to open another program the media center opens. I again close media center, try to open another program and units media center opens instead. It seems to have an impact on the account administrator only. I don't seem to have a problem when logged in user accounts. If anyone has any suggestions, I would be very grateful for your contribution. Aloha.

    Take a look: -.

    When you run an .exe on a Windows Vista-based or Windows 7 computer file, the file may start another program

    http://support.Microsoft.com/kb/950505

    Change the programs that Windows uses by default

    http://Windows.Microsoft.com/en-us/Windows7/change-which-programs-Windows-uses-by-default

    Difficulty of a corrupted user profile

    http://Windows.Microsoft.com/en-us/Windows7/fix-a-corrupted-user-profile

    S.Sengupta Media Center MVP

  • SE error message "Acrobat has encountered a problem and needs to close" when you use Acrobat Reader

    Original title: golfer188

    When I try to load or use Acrobat Reader, I get a message that Acrobat has encountered a problem and needs to close.   The problem seems to be related to the fix to windows installation I get a message asking if the patch installation is correct or who are permitted.   If I try to remove Acrobat Reader I get the same message and deletion does not continue.   If I try to download a new Acrobat Reader installation stops with a message that Acrobat Reader is already installed.   What should do?

    Try this program because it is very good at removing stubborn programs.
    http://www.revouninstaller.com/

    Then, you can try and reinstall the player or use another that people like.

    http://www.foxitsoftware.com/PDF/reader/Reader3.php

    I hope this helps.

  • How can I find and close a program using mirror drivers? My Aero effects do not work because of this

    Aero troubleshooting said to me that ' a running program using a mirror (a type of display driver) driver is not compatible with the Aero visual experience. " In order to display Aero effects, close all programs that use mirror drivers, such as Windows and Windows Live Mesh Remote Assistance. »

    The Aero effects worked well earlier in the day. I had to get help for problems with HP printer and I allowed them access to my computer and they deleted and reinstalled the printer files and that works fine now but the Aero effects are not.

    I'd appreciate any help.

    Hi kristopher_tn,
        
    If it helps, try the steps and check them off below.
    1. click the Start button, type devmgmt.msc and press ENTER.
    2. now in Device Manager, expand graphic cards, under the present, you should be able to see driver mirror.
    3. right-click on it and select Properties.
    4. in the Properties window, on the driver tab, click Uninstall.
    5. After uninstalling the drivers, restart the computer. This should install it automatically the appropriate drivers for it.

    For more information visit http://windows.microsoft.com/en-us/windows7/Update-a-driver-for-hardware-that-isn ' t-work properly

    Driver mirror are used primarily by vpn (virtual private network) / Remote Office Tools / Windows Live Mesh. Remove this driver may resolve these issues.


    Hope this information is useful.

    Umesh P - Microsoft Support
  • Cannot close the camera using EventInjector for touchscreen models

    Hi all

    In my application, I opened the app native camera help

    Invoke.invokeApplication (Invoke.APP_TYPE_CAMERA, new CameraArguments());

    I have a listener added to monitor changes made to the file system. As soon as a new image is taken and added to the file system, the camera is close to the EventInjector.

    I'm running it on JRE 5 and 6, and it works very well for models with no touch screen on the Simulator. However, it will not work for 9550 and 9800. On simulators, it is frozen just after the photo is taken (and probably saved). I loaded my torch, the photo is taken, then he brought me to the camera application instead to close the camera and take back me to my request.

    There should not be a problem with my code, as I moved to a programme of work. So what could be the problem?

    Same assumptions or any help would be appreciated.

    Thank you very much

    Tina

    Hey everybody,

    I solved the problem... It's because you don't have the appropriate permissions for your application to INJECT key events... Use the following code to request the appropriate permissions and you'll be on your way to the injection of events!

               ApplicationPermissionsManager permManager = ApplicationPermissionsManager.getInstance();
    
                if(permManager.getPermission(ApplicationPermissions.PERMISSION_INPUT_SIMULATION ) != ApplicationPermissions.VALUE_ALLOW ||                permManager.getPermission(ApplicationPermissions.PERMISSION_IDLE_TIMER ) != ApplicationPermissions.VALUE_ALLOW  )             {             //Request our permission to inject events             ApplicationPermissions pAppPermission = new ApplicationPermissions();
    
                pAppPermission.addPermission(ApplicationPermissions.PERMISSION_INPUT_SIMULATION);               pAppPermission.addPermission(ApplicationPermissions.PERMISSION_IDLE_TIMER);
    
                  if( permManager.invokePermissionsRequest(pAppPermission) == false)                {
    

    Please give Kudos if it solves your problem

  • "Close other programs using the Webcam" trying to open webcam

    Original title: WebCam

    I have a HP TouchSmart with built in webcam Sonix. If I run Skype I can't play the video because I get a message 'Close other programs with the help of the Webcam'.
    The other program that uses the Webcam is of Cyberlink Youcam. If I close Skype and open Cyberlink, I get a similar message.
    Of course, I don't mean to run both programs at the same time, but I don't know how do to find out what program the computer think using the Webcam.
    Any help will be greatly appreciated.

    Hi Ron,

    Sorry for the late reply.

    I suggest you ask the question in HP support forums to see if there is any type of users who have the same problem.

    http://h30434.www3.HP.com/T5/laptop-and-notebook-computers/CT-p/notebook

  • Close a program using Task Scheduler

    How can I close a .exe program by using Task Scheduler? Eg - is the case of NetMeter, I want the program to automatically close every day at 02:00. It can b done?

    Waiting for a quick response...

    Kind regards.

    Ah I see.  Do not schedule the cmd.exe to run.  Taskkill itself is already an executable command.  So just plan sound directly in the program/script box:

    Taskkill /f /im "NetMeter.exe.


    Do not put anything in the arguments box.  When the program runs, you will briefly see to open the command prompt, the program will be completed, then the command prompt will disappear on its own.
  • How s/n know when and what account perform a function using the database link?

    Dear,

    My application of the CIM team asked DBA to create new function and run it. Function must use the database link for remote database data. So I need to create a new database to their licensing link. Cause we guess we'll experience the performance issue after the user performs this function, or another question and errors may occur. So we want to know when and who use this feature that connects to a remote database through the new database connection in advance. And I also need to know when and which connect to the remote database using this new database link. We have no idea to get this information?  Can anyone recommend how do? Thank you very much.

    Best reqards, Otis.

    Check what business purpose, it will solve.  If the function is so safe, why everyone will use. Only admin people should access.

    All of these additional controls of this kind must be avoided as much as possible to improve the overall performance of the application.

    Still if you need, see the database audit mechanism, specifically designed for this type of activity.

    Kind regards

    Harman

Maybe you are looking for