Modeless dialogs and the active document

I have a modeless dialog (Qt) that contains a checkbox to toggle off and on annotations that our plugin draws.  When the user clicks the checkbox, it calls a function in the plugin code that ultimately makes a call to AIAnnotator->SetAnnotatorActive().  When passing in false, the annotations stop drawing, as expected.  But when passing in true, the annotations don't draw (the plugin doesn't even get the kCallerAIAnnotation message) until the modeless dialog moves or the Illustrator window gets focus.
I have tried to force a redraw and a bunch of other things to try to get the annotations to start drawing, but none of them work.  One thing I found interesting (and is the root of the problem, I suppose) is that at the point the user clicks the checkbox in the modeless dialog, making a call to AIDocument->GetDocument() returns DOC?, which means there isn't an active document.  Without an active document, none of the calls to redraw the window or invalidate the current view will work.
Have any of you experienced this before and come up with a solution?  I'm really at a loss on what to do.

Thanks for the response.
Maybe I'm not calling the AIAppContextSuite functions at the correct time, but they don't seem to do anything in this situation.  I'm pushing the context right before I display the Qt dialog (at which point I have a document and a view), but when the checkbox is clicked, calling AIDocument->GetDocument still indicates there isn't a document.  These click events happen in the Qt event thread, not the plug-in message thread, but I don't believe the click itself is the problem.

Similar Messages

  • I try to 'Print booklet' and receive an eror that "the active document uses multiple page sizes..."

    I try to 'Print booklet' and receive an eror that "the active document uses multiple page sizes..." but all the pages on my document are in the same size (as far as I know)
    How can I deal with this eror?

    This seems to be a bug, and so far the only workaround I know is  to copy/paste everything into a new file.

  • Minumum and Maximum pointsize in the active document with font name

    hi
    How to find the font with point size in active document and how to get the minimum point size and maximum point size used in the active document with font name
    Thanks in Advance.

    Okay, that does look good (without testing it). Does it do its job?
    I think it can be made a bit more efficiently by not running over all text frames, but rather over all stories in the document -- a small change, the rest can stay the same.
    You can also try turning the gathering of used data around. It appears you are now pushing every item immediately into your array, then weed out duplicates. (For my thoughts on the latter, see below!) It might be quicker and more memory-efficient to scan your present array to see if the new item is already in there, and only push when it's not. (Bonus points for a binary tree implementation -- the fastest possible way! But a linear search on the entire array, or on a sorted array and bailing out if you go "past" the current item, may be fast enough.)
    (On Weeding out duplicates; you might want to skip this, as it won't be necessary for the above:)
    Your function UniteSame sorts out and removes duplicates by comparing every item to every other one; then it sorts the array. An alternative can be to
    1. Sort the array
    2. Create a new empty one
    3. Push an item of the original onto the new one.
    4. Skip items of the original list while they are the same as the bottom one of the new list.
    5. Until you run out of items.

  • How can I print ONLY the active document?

    Whenever I go to File/Print the darn PSE 9 program sends all of the working files in the bin to the printer. I've searched online for 2 hours now looking for an answer.
    I like to work with having several to many files in the 'bin' and prefer to only print the active file I'm currently working on without having to close the 'working files' before I can print. How can I print ONLY the active document or file in the project bin? Please help, I've upgraded from PSE 3 to PSE 9 and really like the updated features, but this one pain in the neck default is getting the best of me.

    Thanks for your help, that works nicely. It is good to have control of the printer again.

  • How to Select the Document just back of the Active Document

    If there are 5 documents open in photoshop I want to select the document just behind or back of the Active Document , using script.
    One of my friend suggested me the bleow script, but it is selecting the previous document, not exactly the document back of the active document.
    please help me.
    var id85 = charIDToTypeID( "slct" );
        var desc21 = new ActionDescriptor();
        var id86 = charIDToTypeID( "null" );
            var ref11 = new ActionReference();
            var id87 = charIDToTypeID( "Dcmn" );
            ref11.putOffset( id87, -1 );
        desc21.putReference( id86, ref11 );
    executeAction( id85, desc21, DialogModes.NO )

    I had the same problem. I did not want to go back to the "last viewed" doc but to the doc opened before the active one.
    I use this on F1 key to go back to the previous opened document (index order -1).
    It works great.
    #target photoshop
    // Go back to the last opened doc. If it is the oldest opened one it does not give error window and stays on it.
    if(documents.length>0) {
        var thisIndexImage = getActiveDocumentIndex();
        var theDocs = app.documents;
        if ( thisIndexImage != 0 ) {
            var openedBefore = theDocs[thisIndexImage - 1];
            } else {
            var openedBefore = theDocs[0];
        app.activeDocument = openedBefore;
    } else {
        alert ("You need to have any opened documents to apply this script.")
    // Functions
    function getActiveDocumentIndex(){
         var ref = new ActionReference();
         ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
         return desc = executeActionGet(ref).getInteger(stringIDToTypeID('itemIndex'))-1;

  • Call a function when the active document is closed

    Hi friends
    I have a portion of my script (at true a specific function) that I´d need to be executed every time the user close the app.activeDocument in Photoshop.
    I know there´s a Photoshop script called "Script Event Manager" where we can associate actions and scripts with events (like closing the document). I´d not like to use this script because..as I told...it´s not my entire script to be runned when closing a file..but only a function.
    Tried to search in the Script Event Manager for any event called "onClose" () but sure there´s nothing.
    How could I insert an event in the body of my own script that calls a function every time user close the active document?
    Thank you a lot for the help
    Best Regards
    Gustavo.

    As I said before the close event is really not that useful. In addition to the document already being closed the event descriptor will only have the path to the closed file if it was saved as part of the close event.
    But if you want to play around with this to see if it will be helpful to you here is one way. You will need to add the notifer. This only needs to be done once unless it is removed.
    app.notifiersEnabled = true;
    app.notifiers.add( "Cls ",new File('~/desktop/closeEventHandler.jsx') );
    Then for the event handler script, something like this.
    try {
        if (arguments.length >= 2) {
        var filePath;
        var desc = arguments[0];
        if( desc.hasKey( stringIDToTypeID('in') ) ) filePath = desc.getPath(stringIDToTypeID('in'));
        if( filePath != undefined ) alert( decodeURI( filePath ) );
    } catch (e) {}

  • Digitally Sign All Signature Fields in the Active Document

    I have a script which will sign a single digital signature field by the field name.
    I need to revise the script so it will sign multiple/all signature fields in the active document without having to put the field name in the script, as the field names will vary with each document.
    Can anyone please advise how to modify the script to sign all fields in the active document regardless of the field name?
    function myOtherTrustedFunction()
    app.beginPriv();
    // Get and login to security handler
    var oSigHdlr = security.getHandler( "Adobe.PPKLite" );
    oSigHdlr.login( "123","/c/Documents and Settings/name/Application Data/Adobe/Acrobat/10.0/Security/FirstNameLastName.pfx");
    // Setup Signing Properties
    var chk = this.getField("Checked");
    if (chk != null) {
    // Apply Signature and save back to original file
    var bRtn = chk.signatureSign({oSig:oSigHdlr, bUI:false, oInfo:{password:"123"}});
    app.endPriv();
    Any assistance will be most appreciated.

    Thank you for your help, the script will now count only the signature fields which have not been signed.
    I have added the second part of the script to then sign all of the blank signature fields.
    The script is only signing one of the digital signature fields instead of all of the blank signature fields.
    Can you please advise how I can modify the script to sign all of the blank signature fields?
    var count = 0;
    for (var i = 0; i < numFields; i++) {
        // Get the current field object
        f = getField(getNthFieldName(i));
        // If it's a signature field and not already signed, increment counter
        if (f.type === "signature" && !f.value) {
            count++;
    var myEngine = security.getHandler( "Adobe.PPKLite" );
    myEngine.login( "123", c/Documents and Settings/name/Application Data/Adobe/Acrobat/10.0/Security/FirstNameLastName.pfx" );
    // Sign the field
    f.signatureSign( myEngine,{password: "123"});

  • How can I rip a 10" x 10" post script file from InDesign 6, it keeps telling me "the active document

    How can I rip a 10" x 10" post script file from InDesign 6, it keeps telling me "the active document uses multiple pages sizes and won't print.  My page sizes are all 10" x 10"

    Please post in the InDesign forums here http://forums.adobe.com/community/indesign/indesign_general. They will be able to help you.

  • Link between the Schedule Lines and the GR document

    Hi
    I would like to find the link between the Schedule Lines (of Scheduling Agreement) and the GR document. i.e. which GR has been made against which Schedule Line. I have checked the tables EKET, EKBE, MSEG but there is no link with the Schedule Line, I found the link only with the item number there.
    Thanks
    Prashanth

    Hi
    At the time of posting the GR for a SA you will be not posting this with reference to the Schedule line of the SA item. So system will always update the GR document against the SA item and update qty on the schedule line.
    May be this is the reason we donot have any direct relation ship to material document and Scheclue line
    Thanks & Regards
    Kishore

  • SCCM report to show last logged on user and the Active Directory department attribute of that user.

    I need to create an SCCM report to show last logged on user on all machines and the Active Directory department attribute of that last logged on user.

    You problem is here.
    right
    join v_R_User USR on USR.ResourceID
    = CS.ResourceID
    USR.ResourceID != CS.ResourceID, you need to map the username to the user logon to the PC. By using the user’s department information you will
    end up with unreliable results.
    Anyways you need to make these changes to your query.
    left
    join v_R_User USR on USR.Unique_User_Name0
    = CS.UserName0
    http://www.enhansoft.com/

  • I'm trying to get rid of logmein. I threw away the entire application but I can't remove it form my overhead menu bar and the activity monitor tells me it's still running.

    I'm trying to get rid of logmein. I threw away the entire application but I can't remove it from my overhead menu bar and the activity monitor tells me it's still running. How do I get rid of it completely?

    Install it again and use the developers uninstall instructions
    How to uninstall/install software on your Mac

  • I have a new iMac running OS 10.9 when I use the Command S shortcut it no longer saves the active document it speaks it instead.

    I have a new iMac running OS 10.9.  When I use the Command S shortcut in any of my apps (numbers, text edit etc), it no longer saves the active document it speaks it instead.  How can I revert to the save shortcut function?

    have you looked in
    system preference->Dictiation & speech if it's assigned there?
    or system preference->accessibility if it's assigned there?

  • How can I get the windowRef of the active document window?

    Hello,
    Hou could I get the ADMWindowRef of the active Document window in Illustrator CS4- CS5? I can not use ADMWindowSuite1  because is On Mac OS only.
    Thank you very much to Everybody.

    There's no API for this, not if you want to make use of it in a useful way. You have to write Windows API code to do it. I reccommend using Spy++ to suss out the structure. Frankly, it's pretty annoying. It'd be extremely helpful if the API provided this, but it doesn't.

  • I get a please wait message, and the pdf document never loads?

    I get a Please Wait message, and the pdf document never loads. i have the latest version on my mac- no luck!

    windows xp version x1 the latest.  trying to open  in gmail.
    On Mon, Feb 17, 2014 at 1:23 PM, Claudio González

  • Differences between the Portal Data Collector and the Activity Data Collect

    Hello,
    I want to know what are the differences between the Portal Data Collector and the Activity Data Collector?
    Best Regards.
    Pablo Mortera.

    All of my SQL Server instances  are sql server 2008r2 standard edition(10.50.2500). MDW is existing database, I try to setup collection sets for multiple instances and store data in one central MDW database 
    I create MDW in one instance, then run run configure Management Data Warehouse in target intance. collection sets were created successfully, but job failed with following error:
    Executed as user: COCAD\INTDEPT01SQLAgentC10. The Management Data Warehouse version "00.00.0000.00" is not supported by the current data collector. Please upgrade the Management Data Warehouse by running the Management Data Warehouse Configuration
    Wizard.  Process Exit Code 5.  The step failed.
    Thanks
    PAULqaz

Maybe you are looking for

  • Computer says usb/device not recognized when plugged in??

    When I plug in my sons ipod nano 7th generation, just recently says usb/device not recognized and doesn't light up when plugged into the wall either??? Any suggestions??

  • Randomly choose color for shape

    I am working on a project for fun in which I need to have 144 squares choose a random color out of a pool (array) of predetermined colors and I need these shapes to do so every 1 second in the project. I was thinking the only way would be to write an

  • Adobe sign-in request appears randomly, permanently prevents usage of CCP deployed apps.

    We've used CCP to successfully install the creative cloud suite onto our 10.8.4 build image this year for our labs.  When deployed with Deploy Studio, on average 7 out of 10 computers work.  The other few, when attempting to launch any adobe product

  • Error when doing validation for fieldsoftable inTable maintenance generator

    Hi All, I have issue after doing table maintenance generator for a a table. Actually i have created a table then table maintenance genarator also created. Then i need to do some validatons on few of these table fields so i went to Screen of Table Mai

  • ORA-13516

    Hi SQL> select snap_interval from dba_hist_wr_control; SNAP_INTERVAL +40150 00:00:00.0Can anybody please explain me what is "+40150" in above snap interval ? Can i understand from above output that snapshot interval is set to zero ? because of above