When one ScriptUI palette opens another

I have two general-purpose ScriptUI palettes (one for Indesign and one for InCopy) that calls a smaller palette (which works in both applications) using a doScript() command. I've done the same thing for ScriptUI dialogs, which works just fine because the dialog must be dismissed before the user can do anything else.
With a floating palette, though, the "big" script can call multiple instances of the little one. This is probably a silly thing to worry about, but it just seems sloppy to allow that.
So I'm looking for a way to test whether the little palette is open. I don't think these ScriptUI windows show up in the app.panels array.
The best I've come up with so far is:
if (ntWindowShowing==undefined) {
    ntWindow.show();
    ntWindowShowing = true; }
near the top of the little script, after the "ntWindow" palette is defined. Later, there's an onClose handler that sets ntWindowShowing to undefined. It seems to work OK, but I wonder if anyone has a better solution. I recall an admonition to avoid switching a variable from one data type to another but wonder if there's any harm in going from undefined to true to undefined again.

Didn't exactly set off a debate over best practices. Oh well.
I realized today that the if statement should be:
if (typeof ntWindowShowing=="undefined")
otherwise the script throws an error after a restart of the application. Seems to have something to do with the difference between an undeclared variable and an undefined one.

Similar Messages

  • I can only open 1 page of safari and when I try to open another by the   key it goes to the main page of apps

    I can only open 1 page of safari and when I try to open another by the   key it goes to the main page of apps

    Try force closing the Camera app, followed by resetting your phone.  Double=tap the home button, locate Camera in the list at the bottom, tap and hold it until it wiggles, tap to close it, tap the home button.  Now reset your phone by holding the on/off and home buttons at the same time until you see the Apple logo, then release.

  • Closing one GUI and opening another?

    Hi guys,
    (I didnt really know which forum to post this in, so apologies in advance if this is the wrong one).
    I have created a login screen for a system, LoginScreen.java, which accepts a username and password and checks these on the server for validity. This all works fine.
    Once an account is accepted as valid I would like for the login screen to close, and the actual main GUI, Client.java, to open.
    Can anyone tell me the code for doing this? (closing one GUI and opening another).
    Please ask if you need more information on my code.
    Many thanks!

    You can make the Client.java as your main program then just call the LoginScreen.java.
    import javax.swing.*;
    public class Client extends JFrame {
    public static void main (String[] args) {                     
         Login log = new Login();
         log.show();     
    // Here you can put validation if the user is valid before displaying the main GUI
    // If valid user
         Client clt = new Client();
    clt.show();     
    // } else {
    // System.exit(0);
    public Client() {
         super("Client Java");
         setSize(400, 300);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    class Login extends JFrame {
    public Login() {
         super("Login Java");
         setSize(200, 300);
    }

  • I went to one web page and it asked me if I want to ad a proxy, so I confirmed. But then, when I tried to open another web site it opened the previous one, and all because that adress contains the name of the web site I'm trying to open

    The site I originaly opened is that of brown, but then it asked me to add a proxy, I confirmed, and then it started to take the web adress of pubmed page and that of brown as equal. Meaning, when I try to open pubmed it openes brown.

    Reset the page zoom on pages that cause problems: <b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
    See http://kb.mozillazine.org/Zoom_text_of_web_pages
    Your plugins list shows outdated plugin(s) with known security and stability risks.
    * Shockwave Flash 10.0 r45
    * Next Generation Java Plug-in 1.6.0_17 for Mozilla browsers
    Update the [[Java]] plugin to the latest version.
    *http://java.sun.com/javase/downloads/index.jsp (Java Platform: Download JRE)
    Update the [[Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/

  • Can I use one document to open another?

    I am assuming this is a scripting problem though I am not a scripter myself.
    Basically the situation is this: I have a number of Appleworks documents each of which contains many thumbnails of images, and each thumbnail is also a hotlink to a url for the web page which hosts the full size image. I would be perfectly satisfied with this setup except that the Appleworks icon in Finder is total rubbish, worse even than a Classic icon. I cannot use the Finder (column view) to see from the icon which document it is.
    To get around this, I have also saved the same documents in Photoshop as small jpegs, which give a beautiful, sharp, clear, LARGE icon image in Finder.
    The problem is that I now have PAIRS of documents, one Appleworks and one Photoshop, a total of more than 50 pairs in a folder. What I want to do is to use the jpeg solely to identify the document in Finder, then when I double-click on it, the Appleworks document opens. Can I link document files together so that if I double-click one, the other opens?
    I believe the clue may lie in aliases? I have created an alias of one of the jpegs, and its icon is every bit as good as the original document. Can I now get the alias to point to another document, in this case its paired Appleworks document?

    Hello christopher,
    Well, you may give this another try, though it's a little out of the scope of your original question. (Technically, custom icon and preview are two things ; ))
    The following script will try to get preview image , i.e. pair of 'PICT' and 'pnot' resources, from Photoshop JPEG file and put it in the corresponding AppleWorks 6 file's resource.
    If recent Photoshop JPEG file still stores the preview image in that fashion, this script should help. Otherwise, it would do nothing, hopefully. (Try the script on a test folder first.)
    To run this script, you need to install Satimage.osax that is free scripting additions made and distributed by Satimage-software, France. See script's comment for more details.
    http://www.satimage.fr/software/en/downloads/downloadscompanionosaxen.html
    Good luck,
    H
    -- SCRIPT
      make PICT preview of AW6 file from the paired jpg file with fine preview.
      v0.1
      * Using 'list resource', 'load resource' and 'put resource' of Satimage OSAX.
      Preparation:
        • Install Satimage OSAX in either of:
          /Library/ScriptingAdditions/
          ~/Library/ScriptingAdditions/
        * download sources:
          http://www.satimage.fr/software/en/downloads/index.html
          http://www.satimage.fr/software/en/downloads/downloadscompanionosaxen.html
          http://www.satimage.fr/software/en/downloads/downloadsold_companionosaxen.html
      Usage -
        • Copy this script into new window of Script Editor and run it.
         It will let you choose source folder to process and then
         get 'PICT' and 'pnot' data from jpg files and put them into corresponding cwk files.
        * The script assumes that
          - the source folder contains AW6 files and Photoshop jpg files loosely; and
          - their file name extensions are 'cwk' and 'jpg' respectively; and
          - file names without exension are the same for corresponding files.
      e.g.
      source folder structure -
        target folder:
          file1.cwk  -- AppleWorks 6 file
          file1.jpg  -- corresponding (Photoshop) jpg file with fine PICT preview
          file2.cwk
          file2.jpg
      result folder structure -
        target folder:
          file1.cwk  -- AppleWorks 6 file with fine PICT preview obtained from corresponding jpg file
          file1.jpg  -- jpg files with fine PICT preview (not changed)
          file2.cwk
          file2.jpg
    main()
    on main()
    script o
    property aa : {}
    property fda : choose folder with prompt "Locate the folder to process." -- source folder
    property fdp : fda as Unicode text
    property jpgext : ".jpg" -- jpg file name extension (including period, case insensitive)
    property cwkext : ".cwk" -- AppleWorks 6 file name extension (idem.)
    -- get list of jpg files
    tell application "Finder"
    set aa to (files of fda whose name ends with jpgext) as list -- JPGs
    end tell
    -- get 'PICT' and 'pnot' resource data from jpg file and put them into cwk file.
    set d to -(count jpgext) - 1
    repeat with a in my aa
    set a to a's contents -- Finder reference of jpg file with fine PICT preview
    set n to a's name -- jpg file name
    set a to a as alias -- alias of jpg file
    set p1 to fdp & (n's text 1 thru d) & cwkext -- corresponding AW6 file path
    try
    set a1 to p1 as alias -- alias of corresponding AW6 file
    -- get PICT and pnot resource data from jpg file
    set {PICTid} to list resources "PICT" from a
    set {pnotid} to list resources "pnot" from a
    set PICTdata to load resource PICTid type "PICT" from a
    set pnotdata to load resource pnotid type "pnot" from a
    -- put PICT and pnot resource data to cwk file
    put resource PICTdata to a1 type "PICT" index PICTid with name ""
    put resource pnotdata to a1 type "pnot" index pnotid with name ""
    on error -- ignore it silently
    end try
    end repeat
    end script
    tell o to run
    end main
    -- END OF SCRIPT

  • Firefox initally opens fine , but when I try to open another tab Firefox hangs or I get an unresponsive script message

    firefox initally opens fine right to my homepage. Then a few minutes later it starts hanging and I cannot scroll or do anything until it connects. Similarly when I try to open a new tab, the new tab either hangs forever, or I get an unresponsive script error message. I have tried resetting firefox and starting firefox in safe mode. nothing seems to help.

    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • Hyperlink a word in one pdf to open another pdf on a mac?

    Hi, I have been trying to find a program or app on my mac that will enable me to click on a word in one pdf file from my documents which would then open another pdf file in my documents.  I can't seem to be able to do it on preview via the hyperlink or adobe reader, can anyone help? I assume this would be easy to do on Acrobat X Pro? Any alternative (cheaper/free!) options would be great.
    Thank you!

    With Adobe Acrobat you can add links.

  • How to hyperlink a word in one pdf to open another pdf?

    Hi, I have been trying to find a program or app on my mac that will enable me to click on a word in one pdf file from my documents which would then open another pdf file in my documents. I can't seem to be able to do it on preview via the hyperlink or adobe reader, can anyone help? I assume this would be easy to do on Acrobat X Pro? Any alternative (cheaper/free!) options would be great.

    You can insert hyper-links in PDFs in Preview by clicking on Tools > Annotate > Add Link. The key is to point the link at the local file. The link should start with "file://" followed by the complete path to the file you want to open (e.g.: /Users/Your_Account/Documents/whatsitsname.pdf). In other words, the complete link will be: "file:///Users/Your_Account/Documents/whatsitsname.pdf".

  • Close one vi and open another

    Hi
    Is it possible to open another vi when I click a button and close the current vi.
    thanks 

    Here, try this. Enter the path to the VI you want to launch and run the program. When you press the button, the VI you specified will be launched and the program will be closed.
    Mike...
    Message Edited by mikeporter on 07-02-2007 07:43 PM
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps
    Attachments:
    launch on click.vi ‏19 KB

  • When Firefox tries to open another window, I get a failed script message: Script: chrome://tavgp/content/libs/include.js:595 and I get asked to continue or stop it. When I stop it, the new window opens. How do I fix this?

    Whenever I try to open another Firefox window (by right clicking on a link or if a link tries to open a window - like printing Google maps/directions), I get a pop-up window that says a script is busy or not responding and gives me the choice to continue or stop script. The new window will only open if I choose stop script. The offending script is always: Script: chrome://tavgp/content/libs/include.js:595
    How do I fix this?

    That is a problem with an AVG extension or toolbar.
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions (Aurora/Firefox/Tools > Add-ons > Extensions) is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • When I close firefox it closes but then when I try to open another session my computer tells me that firefox is still running and I have to restart me computer to get it to work again.

    The message that pops up when I try to open firefox again is something like, "Firefox is already running but not responding, please close Firefox or restart your computer before opening a new session."

    https://support.mozilla.com/en-US/kb/Firefox%20hangs <br />See '''hang-at-exit'''

  • Mantain a Session in one application after opening another application

    Hi
    My Requirements is like this..
    I have one ear apllication running in one place.. We we click a link on this applcation it has to open up a third party application in another widow., and session in the current application has be maintained until third party application is explicitly ask's or time out or expires...
    Thanks
    Venky

    Interesting! The question then is, how would you know whether the third-party application has timed out? Is it possible to have some kind of contract with the third-party application? If you can, you can use AJAX to keep polling the server with some dummy request in the parent window to keep its session alive until a variable is reset, which will be done by the child window when a timeout is detected. This is one option that I can think of..
    Edited by: ganeshmb on Jun 20, 2008 10:43 PM

  • Closing one applet and open another...

    Hi all,
    What I currently have is a very basic applet that requires you to type in your password and follow by pressing the OK button. What I want it to do is following the pressing of the OK button, I want that initial applet to close and have another applet open. It doesn't seem too over the top difficult but right now I have no idea. Please help.
    Thank you

    I do work with applets. Reply #4 is the correct one IMHO.
    If you don't understand what he is saying, I will try to put it
    in other words.
    1. Login dialog. Once your applet starts, it will display nothing
    essential, perhaps just a nice background and it will open a
    dialog for userid-password. If authentication is ok, close the
    userid-password dialog and display in your applet whetever you
    have in mind.
    2. Card layout. Your applet will start by asking for userid-password
    in its area inside the page. When authentication ok, display whatever
    the applet is supposed to display.
    In both scenarios, there are no two applets, but a single applet that
    changes from state 1 (authentication) to state 2 (display data).
    The only difference between the two scenarios is aesthetic,
    i.e. do you want a popup for userid-password or you want it inside the
    page? I would go with the card layout. Both are relatively easy.

  • Client application freezes permanently when one user logoff and another user take that session on windows server 2008 r2

    Hi,
    we have windows server 2008 r2 and In our application there are three server and on e client application.
    My client application freezes on a specific scenario.
    Steps taken to hang are following:-
    1. start client application
    2. open an module named by XYZ
    3. login to remote machine with another session./ Another user login from their computer.
    4. connect with the session which have client application opened.
    5. Whenever the session is forcibly taken client application becomes unresponsive.

    Hello,
    The Windows Desktop Perfmon and Diagnostic tools forum is to discuss performance monitor (perfmon), resource monitor (resmon), and task manager, focusing on HOW-TO, Errors/Problems, and usage scenarios.
    Since your post is off-topic, I am moving it to the
    off topic forum.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • One keynote file opens another

    We use Keynote to display messages in various buildings on plasma TV's. Currently we have no way to display building specific slides in only one building. We would like to be able to have a standard keynote file that would be displayed in all building, and then at the end of that file, would open a building specific keynote file, then revert to the original running in a loop.
    Any suggestions on how to do that ? I can't see that Keynote has a way to do any internal file to file scripting. Thank you.

    Any suggestions on where to find something like that ? I have never used AppleScript, and I have tried to put an Automator workflow together but that didn't work either.

Maybe you are looking for

  • How to get the last inserted Autoincrement value in Java for Pervasive DB

    Hi, I need to get the last inserted auto incremented value after the record is inserted IN JAVA For ex. consider we have 4 columns for the myTable in the PERVASIVE DATABASE V10 autoid - identity column (auto increment column) userID userName pageID i

  • Reader 9.1 printing garbage

    Hi, I have a problem with Reader 9.1 When I print a pdf document from it, the page is filled with 'gobbledy-****' characters, but in the correct positions. (ie. the lines are in the correct place and roughly the right length). The characters are the

  • Downloading files from report on page

    on apex.oracle.com I have an app and I have uploaded a few pdf files via the "shared components->files->static files" The pdf name is ssgr.pdf I've got a table within my schema for item information and one of the columns references these files. I hav

  • Printing Flag Based on the Condition Request

    Hello I have a requirement where i need to check two conditions on Date and Print the Date in Red and Flag(Symbol) adjacent to the Date, I used Conditional Format and gave my Conditions and then i am ableto print the date in Red , Below is my Conditi

  • Installing upgrade on a new computer

    I have a new computer and want to re-install an upgrade (acrobat 8) but the new computer doesn't have the original software to upgrade from, and I can't find my original software disc (might have been a download..)