JavaScript: How do you pass the currently active doc to a dialogue in a menu item?

I use Adobe Acrobat 11.0 Standard on Windows 7, and I have a problem with the menu item that I create.  The menu item calls a dialog box that prompts the user to select a page in the active document.  The problem is, I can't find a way to send the currently active document in the dialog box.  I went through the rest of the documentation, did some research on Google and here in the Adobe forums, but do not have whatever it is turned upward.  The AcroJS API gives the following solution (which is under app/methods/execDialog):

This function attaches the Doc object to the dialog box, then past the dialog box to the app.execDialog method. The dialog4 object and this function may be at the level of the document.

function dotheDialog (dialog, doc)

{

Dialog.doc = doc;

retn var = app.execDialog (dialog)

}

Finally, the following script can be run an action of mouse-to the top, for example.

dotheDialog (dialog4, this);

I did this exact thing, but in the dialog box, the value of this.numPages still comes out as indefinite, indicating that the current document has not yet been adopted.  My own code looks like this:

function dotheDialog (dialogue, thisDoc) {}

Dialog.doc = thisDoc;

retn var = app.execDialog (dialog);

}

app.addMenuItem({)

cName: 'Testbox Dialogue. "

cParent: "change."

cExec: "dotheDialog (templateDialogue, this);"

});

where templateDialogue is the name of my own dialog, rather than dialog4.  I'm not sure of what concerns the variable retn that they declare in the documentation, but I have tried with and without this part, and it doesn't seem to make a difference.  Does anyone know how to do this?

The reference to the document is a property of the dialog box, so that you access the inside like this:

This.doc

And if you want to access the number of pages, like this:

this.doc.numPages

Tags: Acrobat

Similar Questions

  • How do you define the current-time indicator to return to the point that he started on an audio overview?

    in the most recent version of the software, how do you define the current-time indicator to return to the point that he started on an audio overview? He did it in the old version. I don't find a setting for this in 2015 software. Thank you

    You can use the zero on the numeric keypad key. See the sixth in this article:

    known issues in after effects CC 2015 (13.5). After the effects of interest area

  • Pass the current sequence as an argument in customize tool Menu

    Is it possible to spend the full path and file name as argument in the Menu Tools Customize?

    Basically, I have an external tool that works with a movie file, and I would like to call from the Tools menu.  It is a type of order, but I don't know what to put in the arguments.  I found a post where someone said to use '% FILE execute%', but it does not work.

    In addition, if there are other available keywords, where is this list?

    Thank you.

    Hi Richard,

    It seems that it is not a way to do it using the command type.  The problem is that you can't use an expression to specify the arguments for the executable and you use an expression to get the path of the current sequence file.

    However, you can wrap your executable in a sequence file that has only a single step; the call of your executable file.  If you place a not executable call in your sequence, you can specify the argument as the current path by using the expression RunState.InitialSelection.SelectedFile.Path.

    Add a new item in the Tools menu, and then select your sequence of wrapper.

    See you soon,.

  • How do you find the current value of each sample when collecting a finite number of samples

    My program works with an external clock with no constant pulse intervals and acquires a value of voltage on the front of these impulses.  Is there anyway to get the value of the voltage at each pulse without having to wait until all samples are taken.  I would Normal 0 false false false MicrosoftInternetExplorer4 / * Style Definitions * / table. MsoNormalTable {mso-style-name: "Table Normal" "; mso-knew-rowband-size: 0; mso-knew-colband-size: 0; mso-style - noshow:yes; mso-style-parent:" ";" mso-padding-alt: 0 cm 0 cm 5.4pt 5.4pt; mso-para-margin: 0 cm; mso-para-margin-bottom: .0001pt; mso-pagination: widow-orphan; do-size: 10.0pt; do-family: "Times New Roman"; mso-ansi-language: #0400; mso-fareast-language: #0400; mso-bidi-language: #0400 ;} programmatically raises an event when the voltage reaches a certain level during the scan if so why I need to constantly monitor the voltage. "}

    Any help would be great

    Hi JED1986

    I have two solutions for you, for your problem.

    The first idea I would recommend creates the code below:

    Remembeer to define the sources correctly, including the clock to read source as your external clock. The above code will be permanently read 1 single sample with a rising edge, write to the disk, clear and will continue to read the following sample.

    Another way to proceed is to use an express VI and set the mode of acquisition as ' on demand ' with 1 sample currently playing. This is illustrated below and highlighted in red:

    I hope this helps. Please let me know how you go.

  • How do you pass the insert a disc

    I download my Adobe Creative Suite 3 without a hard drive.

    How to insert a portion of disc looking for AdobePDF.dll file download?

    Hi ggzar,

    Please download Adobe CS3 directly from this link Download CS3 products.

    Let me know if you are still having a problem.

    Kind regards

    Nicos

  • How can I automatically get a new tab always be a copy of the current active tab?

    The extension add-on "NewTabURL' (from"sogame") provided the option I want to and used for a number of years. But it has stopped working when Firefox has been updated to version 16.0. When I click to a new tab, all I get is a completely blank tab. How can I automatically have the new tab always be a copy of the current active tab?

    The extension "NewTabURL" can be revised to work in version 16 or 17? If not, if not, how can I get the new functionality of the tab I want? I can't find another extension that provides this feature.

    Milt Beychok

    Yes, the balls are always a problem because they do not have three buttons on the mouse and you cannot Middle-click.

    You can always try to click on the "Restore default" button in the window customize if you want to have all the toolbar buttons in the default position.

  • Watch does not recognize the weight class as exercise-how can you add the duration of activity manually because none of the presets eg elliptical etc. is appropriate. Also does not count calories for example 35 when the rest of the group is around 500

    Look does not recognize the weight class as exercise-how can you add the duration of activity manually because none of the presets etc for example elliptical is appropriate and therefore do not count toward the daily goal. Also does not count calories for example 35 when the average of the others in the group is around 500.

    Hello

    When you use the application of the training session, choose the type of activity that best fits your business. For anything else - like weight - select the other category.

    During the follow-up of one year to the next helps:

    • Activity app will credit the ring of progress of exercise with one minute for every minute of the workout.
    • Active calories will be based on the data recorded by the heart rate sensor or a brisk walk, whichever is greater.

    Note, however, that the heart rate sensor is likely to give better results for the workouts that involve rhythmic (for example running) rather than the irregular movements.

    More information:

    Use of the workout on your Apple Watch - Apple Support

  • How to know which is the current active screen despite the menu is open?

    Hi all

    I'm developing a BlackBerry mobile application where a place in the program I want to know who is the current active screen and my request for a specific form, I want to take some actions.

    I realized that there is a follows;

    UiApplication.getUiApplication () .getActiveScreen)

    But the problem I face is when the Menu is opened on the screen of my application of that method above, gives me something net.rim.device.api.ui.menu.DefaultMenuScreen@629f6b5e in the active screen so for this instance even if my action should be handled is not due to the fact that the menu is the active screen.

    Y at - there no possibility of finding the menu screeen is open on top of what screen?

    Thank you

    Mukesh

    Have you tried with getScreenBelow and getScreenAbove?

  • How to change the position of 'you passed the test?

    Hello

    I need help on how to change the position of the message "congratulations, you passed the test. Perhaps the failure message.
    It should be in the Middle, but now to the left, it sinks in the background.
    I Don t see where to change it. All of the index are adjustable but it escapes me...


    Thank you very much!

    I think you are talking about the area of control on the slide to score? Move this area result or score slide himself slide.

  • How can you cancel the download of an update that was started by after having pressed the button "Check for Updates" in the window "On Firefox", please?

    How can you cancel the download of an update that was started by after having pressed the button "Check for Updates" in the window "On Firefox", please? If possible, please cover all platforms, Mac, Windows, Linux, although the first mentioned is what currently applies to my situation.

    Thank you.

    Such a download is usually recorded in a updates or updates folder in the program folder or the Firefox application.
    You can delete this folder to cancel the download.

    If the files have already been downloaded, then delete the files in the folder updates\0 and updates.

    Mac: /Applications/Firefox.app/updates "/path_to/Firefox.app/Updated.app"
    Linux: "/path_to/firefox/updated"
    Windows: C:\Users\<user>\AppData\Local\Mozilla\Firefox\Mozilla Firefox\updates
    
  • I reinstalled Firefox Desktop, I downloaded my favorites of Carbonite, how can I get the current Firefox to accept?

    See above

    I reinstalled Firefox Desktop, I downloaded my favorites of Carbonite, how can I get the current Firefox to accept?

    You do backup your bookmark as a .json file?

    Restoration of bookmark

  • How do you avoid the port scan?

    How do you avoid the port scan, or how you define system to block the port scan?

    The Windows Firewall and a router allows to hide all current ports of the analysis. You can test it by using the Shields Up link here - http://www.grc.com/default.htm

    Jim

    Microsoft MVP - moderator of the Forum - consumer security live a care - Live Mesh - Microsoft Security Essentials

  • How do you lock the device 10 BB programmatically

    How do you lock the device 10 BB programmatically. Please suggest solutions to achieve this.

    Thanks in advance.

    Hello

    I guess that you are looking for this via the Android Runtime? This is a device that is not currently supported feature.

    See you soon,.

    Matt

  • How to determine whether the current operating system is windows, or MAC?

    How to determine whether the current operating system is windows, or MAC?

    CSparrow wrote:

    operatingSystem var = $.getenv ("OS");

    operatingSystem = operatingSystem.toString ();

    alert (operatingSystem);

    It gives me Windows NT Windows 10

    With the help of:

    alert($.os);
    

    works for me.

    (result: Windows/64 10.0)

    and the Silly-V code

    Folder.FS

    gives you the name of the operating system

  • How do you install the creative cloud on several computers using the same license?

    How do you install the creative cloud on several computers using the same license?

    Installation on multiple computers can be done independently of the subscription.  You only need the lic3ense when it comes to activation, you have two active facilities (signed in).  Just install the desktop application and use it to install the applications, and then connect to activate.

    https://helpx.Adobe.com/creative-cloud/help/download-install-app.html

    Creative cloud to desktop
    https://helpx.Adobe.com/creative-cloud/help/creative-cloud-desktop.html

    Sign out, sign in | Creative office cloud app
    http://helpx.Adobe.com/creative-cloud/KB/sign-in-out-creative-cloud-desktop-app.html

    Help of activation & deactivation
    https://helpx.Adobe.com/x-productkb/policy-pricing/activation-deactivation-products.html#a ctivate-how-to's

    Install, update, or uninstall applications
    http://helpx.Adobe.com/creative-cloud/help/install-apps.html

Maybe you are looking for