[JS/CS4/CS5] Catching a selection event in a ScriptUI interface.

I've got this ScriptUI interface (javascript based), and now I wonder if it would be possible to change one of its button captions depending on whether anything is selected or not, in the active document (would also have to be updated if the user selects or opens another document).
1. Is it possible to write event listeners for this?
2. Would it be possible to include this in the same script as the rest of the Script UI interface code (that is, I'd prefer avoiding a separate file in the startup folder).
3. What's the best source of information regarding events, which ones there are, and how to handle them in javascript?
Andreas

1. Yes. The selection events work well in my experience.
2. Yes, you don't have to add them at startup. You can do something like:
app.addEventListener("afterSelectionChanged", selectionChangedFunction);
before you open your window. Remove the listener in the onClose event of the window. I think you'll have to have some error trapping in the selectionChangedFunction to deal with app.selection erroring after a document close or during a revert.
3. See this thread for an extension that lets you see events as they're happening.
Jeff

Similar Messages

  • Personas 2.0: How to catch the selection event of a dropdown list?

    Hi Personas 2.0 experts,
    The use case:
    I want to use a text field to show the "key" of an item that can be selected in a dropdown list.
    The issue:
    After clicking the list and selecting an item, the text field is not automatically updated with the newly selected item content.
    Anyone has an idea to how make such an auto update (pls note I don't want to use an extra button to do the update, just by clicking the list only)?
    Thx.
    Dong

    To display the key (the actual value) that's selected in a dropdown, there is a property called ShowKeys which you could set.
    However if you'd want to show the selected value in another field upon picking an option, this would require an event associated in Personas 2.0 with the selection of a dropdown value. This is currently not available so I'm afraid what you are looking for is not possible.
    Edit: It turns out I was wrong... there is an option (at least it's there in SP3) which allows linking a script button to the dropdown property OnValueChanged, so you can use this to do any script action you need when the user selects a value.
    (thanks, Sushant )
    Message was edited by: Tamas Hoznek

  • How to catch the mouse event from the JTable cell of  the DefaultCellEditor

    Hi, my problem is:
    I have a JTable with the cells of DefaultCellEditor(JComboBox) and added the mouse listener to JTable. I can catch the mouse event from any editor cell when this cell didn't be focused. However, when I click the editor to select one JComboBox element, all the mouse events were intercepted by the editor.
    So, how can I catch the mouse event in this case? In other word, even if I do the operation over the editor, I also need to catch the cursor position.
    Any idea will be highly appreciated!
    Thanks in advance!

    Hi, bbritta,
    Thanks very much for your help. Really, your code could run well, but my case is to catch the JComboBox event. So, when I change the JTextField as JComboBox, it still fail to catch the event. The following is my code. Could you give me any other suggestion?
    Also, any one has a good idea for my problem? I look forward to the right solution to this problem.
    Thanks.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test3
    extends JFrame {
    // JTextField jtf = new JTextField();
    Object[] as = {"aa","bb","cc","dd"};
    JComboBox box = new JComboBox(as);
    public Test3() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = getContentPane();
    String[] head = {
    "One", "Two", "Three"};
    String[][] data = {
    "R1-C1", "R1-C2", "R1-C3"}
    "R2-C1", "R2-C2", "R2-C3"}
    JTable jt = new JTable(data, head);
    box.addMouseListener(new MouseAdapter() {
    // jtf.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent e)
    System.out.println("-------------------JComboBox mouseclick....");
    jt.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent e)
    System.out.println("-------------------JTable mouseclick....");
    // jt.setDefaultEditor(Object.class, new DefaultCellEditor(jtf));
    jt.setDefaultEditor(Object.class, new DefaultCellEditor(box));
    content.add(new JScrollPane(jt), BorderLayout.CENTER);
    setSize(300, 300);
    public static void main(String[] args) {
    new Test3().setVisible(true);
    }

  • JSFL - Commands working in CS3, not in CS4 / CS5 (library.selectItem / library.expandFolder)

    Hi there,
    I have a script that works perfectly fine in CS3, but does not work in CS4 and CS5.
    This script is called "selectInLibrary".
    You guessed it, what it does is select/highlight in library the symbols selected on the stage.
    My issues are with the "library.selectItem" and "library.expandFolder" methods. They are simply not working in CS4 / CS5.
    If anyone can help me with this, it would be awesome.
    Code goes as follow:
    function selectInLibrary(){}
    var _proto_ = selectInLibrary.prototype;
    _proto_.aAlreadyDone = new Array();
    _proto_.DOM = fl.getDocumentDOM();
    _proto_.oXMLUI;
    _proto_.Init = function(){
              fl.trace("==== selectInLibrary v2.0 (for CS4) ====")
         var _aSelection;
         if (this.DOM == undefined){
              alert ("You need to open a Flash File First!");
         }else{
              this.CheckSelection();
    _proto_.CheckSelection = function(){
         //     Make sure at least 1 stage element is selected
         if(this.DOM.selection.length <= 0){
              alert ("You need to Select a elements on the Stage");
         }else{
              //     Clear library selection
              this.DOM.library.selectNone();
              //     Loops through selected stage items...
              for(var i = 0; i < this.DOM.selection.length; i++){
                   //     ...if selected elementType is "instance"...
                   if(this.DOM.selection[i].elementType == "instance"){
                        fl.trace("Element " + this.DOM.selection[i].libraryItem.name + " already processed? " + this.ElementExist(this.DOM.selection[i].libraryItem.name));
                        //     ...if selected element has not been processed...
                        if(this.ElementExist(this.DOM.selection[i].libraryItem.name) == false){
                             fl.trace("Processing: " + this.DOM.selection[i].libraryItem.name);
                             //     ...adds selected element to array aAlreadyDone.
                             this.aAlreadyDone.push(this.DOM.selection[i].libraryItem);
                             //     ...select the item in the library.
                             this.DOM.library.selectItem(this.DOM.selection[i].libraryItem.name, false, true);
                             //     ...deploy item's folder.
                             this.deployFolder(this.DOM.selection[i].libraryItem.name);
                             fl.trace("----");
                        } else {
                        fl.trace("Skipping " + this.DOM.selection[i].libraryItem.name + ": Already processed");
                        fl.trace("----");
    *     This Remove the name of a movie clip from the path 
    _proto_.catPath = function(_sText){
         var _nLastPosition;
         fl.trace("catPath: " + _sText);
         for(var i = 0; i < _sText.length; i++){
              if(_sText[i] == '/'){
                   _nLastPosition = i;
         fl.trace("catPath return: " + _sText.substring(0, _nLastPosition));
         return _sText.substring(0, _nLastPosition);
    *     This will deploy the folder contaning the Folder
    _proto_.deployFolder = function(_sText){
         fl.trace("deplyFolder: " + _sText);
         if(this.PathExist(_sText) == true){
              _sPath = this.catPath(_sText);
              fl.trace("new _sPath: " + _sPath);
              this.DOM.library.expandFolder(true, false, _sPath);
              this.deployFolder(_sPath);
    *     This methode return if this is a path
    _proto_.PathExist = function(_sText){
         for(var i = 0; i < _sText.length; i++){
              if(_sText[i] == '/'){
                   return true;
         return false;
    *     Check if the element already been modified.
    _proto_.ElementExist = function(_sElement){
         _ret = false;
         for(i = 0; i < _proto_.aAlreadyDone.length; i++){
              if(_sElement == _proto_.aAlreadyDone[i]){
                   _ret = true;
         return _ret;
    /****** END CLASS DEFINITION *****/
    var oSelectInLibrary = new selectInLibrary();
    oSelectInLibrary.Init();

    var succes = fl.getDocumentDOM().library.expandFolder(true,false);
    // traces "success : true"
    fl.trace("success : " + success);
    But folder does not expand
    flash 11 on a selected folder
    tried with third arg as path without success
    Seems like another fl.blackmagic trick
    I you found something ?
    Regards

  • Combobox select event opens user defiend form

    helo expert
      on combo select event,i want to open a list of item of my user defined form.
    on chosing perticular item if should get copied into matrix

    Hil
    Use Et_Combo_Select event to catch the combo select, and write your opening and copy code inside
    Regards,
    J.

  • Not able to reach start of selection event in the called program

    hi,
    I have a report 1 in which i am calling report2 using below syntax,
    SUBMIT Report2  VIA JOB gv_jobname NUMBER gv_jobcount
                 WITH s_g_yr  IN s_g_yr
                 WITH s_c_rf  IN s_c_rf
    AND RETURN.
    the problem is when report 2 is called it exists after event "at selection screen output" and does not go in the event "start of selection". 
    Please advise. how can i reach the "start of selection" event where all the processing logic is specified..
    Thanks and Regards,
    Kriti

    Hi,
    In your report you have used the event AT SELECTION-SCREEN OUTPUT. So, first it will trigger this event and then it will go for START-OF-SELECTION event.
    Events will trigger in this following way.
    LOAD PROGRAM
    INITIALIZATION
    AT SELECTION-SCREEN
    AT SELECTION-SCREEN OUTPUT
    START-OF-SELECTION
    END-OF-SELECTION
    TOP-OF-PAGE
    END-OF-PAGE
    In above sequence events will trigger in report.
    Regards,
    Shankar.

  • Finding selected event in iCal

    I want to run a script that processes the currently selected iCal event / todo. (sync it with a Filemaker DB).
    I cant find a command that returns the selected/current/active iCal object. I can only find an object one with a given property value.
    I'm a bit new to this so any pointers would be greatly appreciated.
    OTBC

    Hi OTBC,
    I was waiting for someone to post something Apple maight have added in newer versions of iCal, but I guess they didn't add anything.
    There is no selection property in iCal, but you can create macro like statements to script applications. So, as a wrokaround in iCal, you could use keystrokes to get the name of the currently selected event.
    tell application "iCal" to activate
    tell application "System Events"
    tell process "iCal"
    keystroke return
    keystroke "c" using command down
    end tell
    end tell
    This would copy the summary of to selected event. You could tab to tab through the information for the event. This might help you pinpoint the event in the case where there are several events with the same summary. Like a macro you would have to test it out in iCal to find the right combination of keystroke and ui scripting.
    Note that it is very hard to get recurrence events.
    gl,

  • Long-time Elements user who had planned for CS4, CS5 or CS6 on disk

    As a long-time Elements user who had planned to purchase Photoshop CS4, CS5 or CS6 right before the Cloud changed everything, why can't I get the cloud subscription for $9.99? This makes me want to just buy an older disk on EBay or elsewhere.

    why can't I get the cloud subscription for $9.99?
    Are you trying to subscribe to the Photoshop Photography Program (PS+LR)?
    That deal is available to anyone, regardless of whether you've purchased Adobe software in the past or not.
    What is preventing you from subscribing?

  • Since I upgraded to Yosemite I can no longer upload photos to eBay by selecting "events"  all my photos pop up together.  Anyone know how to fix this?

    I recently updated to Yosemite 10.10.1.  Since I updated I can no longer upload photos to eBay, Shutterfly, Craigslist by selecting "events".  It is no longer an option.
    All my photos come up as one entire library.  When I view them in iPhoto they are divided into events, however once I go to upload them the entire library appears without any defining options, such as "events", recent imports, etc.   I thought at first this might be an issue with eBay, but realized it wasn't when I tried to list on Craigslist.  This is a nuisance and time consuming process.  Does anyone know if there is a fix in the future or if I am just missing some quick fix?

    I would like to add that Comcast is my internet provider. Perhaps that is part of the issue although the Connection Doctor confirms the mail box is connecting to the internet. No other function processes when Connection Doctor program is used to find the source of the issue. I have read forum posts but am unable to find a way to get my Apple mail to be delivered to my computer. It worked fine up until I chose to transfer mail to the Cloud. My mail account is a .mac account.
    Still hoping someone out there can help me.
    thanks,
    anne

  • Using Photoshop CS4/CS5 and Lightroom 2/3 on Win 7 vs OSX

    I do NOT want to re-ignite the no-win discussion of pc vs mac. Now that CS5 is announced, yet again as I preprare to upgrade from CS4, I ask if I should convert fromWin7 64-bit on a PC to MAC Pro running OSX. I currently run a WIN 7 64-bit PC with 8 GB Ram. I would consider buying a MAC PRO with 8 GB RAM. The machine(s) are used strictly for image processing, no general office work or general internet surfing except as relates to supporting my software, etc. 
    I don't want to discuss PC vs MaC but I would like to understand the limits, advantages/disadvantages of one platform vs the other as specifically relates to CS4/CS5 and/or Lightroom 2/3. In other words are there functions or processes that I can do on one platform and not the other, or do better on one compared to the other, not does one cost more than the other any comments or help?? Mike

    As a casual user of CS products, I find no substantive differences between using them on a Mac vs. PC. I can cross post this question over to the Photoshop forum (originally posted to the Photoshop.com web site forum, which is not just about the desktop app).
    It's probably going to become a Mac vs. PC discussion, since the question is inherently 'which is better', but hopefully people will remain objective and constructive!
    -Mark

  • Error in at line-selection event...

    Hello experts,
    In my report, I am hiding the values of BUKRS, ANLN1 and ANLN2 during my loop.
    I am using field symbols as my work area for my itab which is it_output. The problem
    is, when I try to do this in my at line-selection event:
    at line-selection.
    data: cursorfield(20) type c.
        get cursor field cursorfield.
        case cursorfield.
         when '<FS_OUTPUT>-ASSET_SUBNUM'.
         SET PARAMETER ID 'BUK' FIELD <FS_OUTPUT>-bukrs.
         SET PARAMETER ID 'AN1' FIELD <FS_OUTPUT>-asset.
         SET PARAMETER ID 'AN2' FIELD <FS_OUTPUT>-anln2.
        endcase.
    It says that it can't recognize the fields. What am I doing wrong? By the way, I am using
    ABAP Objects in my report. Help would be greatly appreciated. Thanks again guys and take care!

    Hi Viraylab,
    Have you assigned the fieldsymbols ?
    ASSIGN IT_OUTPUT to <FS_OUTPUT>.
    Cheers
    VJ
    Message was edited by: Vijayendra  Rao

  • CS6 Beta Modifies CS4 & CS5 Bridge File Associations (W7 Pro 64Bit SP1)

    Symptoms:
    After installing CS6 including bridge CS6 onto a W7 pro 64Bit Machine with SP1.
    The File associations in the existing copies of CS4 and CS5 bridge are updated to make the CS6 Beta the default programme for opening the majority of file types from either CS4 or CS5 bridge.
    When right clicking ona file from CS4/5 bridge only the option of opening in CS6 is presented
    Expected Bahaviour:
    I expected that CS6 would be the default programme launched from CS6 bridge but that CS4/CS5 would remain the default programmes launched from their own versions of bridge.
    Setting CS6 as the default file association in previous versions of bridge makes no sense at the Beta stage, as it interupts a clean migration back to existing workflow.
    I would also question the value in not preserving the existing file associations in prior versions of bridge in the final CS6 release, as there are cases when it might be desirable to go back to a previous version of CS, in which case opening that version of bridge and launching directly into the prior versions of CS is very desirable.
    Is there anyway to quickly restore the previous associations in CS4/CS5 bridge and be sure that they are exactly the same as prior to the CS6 beta install ?

    Sorry for the noise. I misunderstood your depth of knowlege and what you had tried. I also committed the sin of not testing the procedure all the way through because I did not want to change the association on my computer. I get the same behavior.
    Guess for .jpg
    Registry shows for .jpg:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\UserCho ice  Progid = Applications\Photoshop.exe
    HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Applications\Photoshop.exe\shell\open\command  (Default) = "C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Photoshop.exe" "%1"
    UserChoice seems to be added when I made the association choice. Note that it points into Applications with a non-version specific Photoshop.exe. Within HKLM\....\Applications there is only one Photoshop.exe -- no version -- and that entry points to CS6.
    I believe that explains why the browsed to association is CS6. It does not explain why it would be set up that way. Probably has something to do with Windows special handling of certain file extensions. Beyond my depth and tells me I am not going to find a solution.

  • HT4796 After migrating all of my adobe software (Cs4, cs5, etc.) to my new imac, the software won't open due to many errors. Any help on this?

    After migrating all of my adobe software (Cs4, cs5, etc.) to my new imac, the software won't open due to many errors. Any help on this?

    Welcome to the Apple Support Communities
    Adobe software is conflictive when you use Migration Assistant because their applications don't work properly after migration. If you keep the DVDs or the installers of your software, use them to reinstall all your Adobe applications and they should start working correctly

  • How can you tell what version of Illustrator (Ver. 10, CS4, CS5, CC Ver.17, etc.) saved artwork is in?

    Our company needs to save artwork we create in Illustrator in different versions depending on our various client's needs. Is there anyway to know what version of Illustrator (Version 10, CS4, CS5, CC Version17, etc.) saved artwork is in? When we view preferences it just shows the current version of the application not the version the individual artwork is saved at. Any advise would be extremely helpful. Thanks.

    If you are on a Mac there's always Get Info

  • Dynamic TaskFlow Gets Refreshed on Catching a Contextual Event

    Hi,
    I am using Contextual events in my application. I have 2 task flows in my parent page. One TF is raising an event and the other is catching it. As my catching TF is a dynamic TF, I have specified the event map in it only.
    Everything is working as intended only that my dynamic TF gets refreshed when it catches the event! I do not want that. I want to explicitly refresh any UI component that requires to be refreshed, not the whole TF.
    So is there any specific property of task flows that make it to refresh itself when ever it catches any contextual event?
    Also I have tried 'Refresh="ifNeeded"' and 'RefreshCondition="#{false}"' in my dynamic taskflow specification in the parent page but it does not make any difference.
    Regards,
    Rahul Saxena

    Rahul,
    there is no setting for this. If however the managed bean you setup for handling the dynamic region is in backing bean scope (or request scope) then chances are that the region is refreshed because the bean restes after the request (just assuming here). Yournot giving us much to chew on (no JDeveloper version, no implementation details etc. ) So its hard to provide further ideas. As a last resort, if you have a support contract, you can contact customer support with a test case
    Frank

Maybe you are looking for