How do I assign a PageItem within an OnClick handler

Hello

I am trying to put the a PageItem geometricBounds and that works fine until I do in a button click Manager, then nothing happens.

Code:

function createDialog(header, message, pageItem) {
     var dialog = new Window("dialog", header),
          textArea = dialog.add("statictext {preferredSize: [200, 100], properties: {multiline: true}}"),
          correctButton = dialog.add("button", undefined, "Correct");
     
     textArea.text = message;
     
     correctButton.onClick = function() {
          alert('Before');
          pageItem.geometricBounds = [1, 1, 8, 8];
          alert('After');
     }
     
     dialog.show()
}

In addition, only the first alert appears. 'After' is never shown.

Any ideas?

A dialog box is a modal window. If it is running the script is unable to 'write' to indesign (it can read the values of various objects, such as geometric limits) but it can't edit them.
Solutions:
(a) use a palette.

(b) in the 'OnClick' save the geometric limits, but only to apply once the dialog box is closed:

If (Show () == 1) {pageItem.geometricBounds = myRecordedBounds ;}

Tags: InDesign

Similar Questions

  • How can I assign a browser to a specific office in El Capitan?

    How can I assign a browser to a specific office in El Capitan?

    You can change your default browser by following these steps:

    1 from the Apple menu, choose System Preferences, then click general.

    2 click the 'Default web browser' dropdown and choose a web browser, such as Safari.

  • How to insert as an entry within the formula variable, the total time on the scope window?

    How to insert, as an entry within the formula variable, the window of total time on the scope (i.e. of 20ms/div x 10 div = 200ms)?

    HERE'S A SAMPLE QUESTION:

    FORMULA FOR INTEGRAL ACTION:

    STATISTICS:

    Input variable: DPO4034 (CH1);

    Box: number of samples.

    FORMULA

    Input variable 0: DPO4034 (CH1); alias: x 0

    Input variable 1: 'time window Total out of scope?. " alias: x 1

    Input variable 2: number of samples (CH1); alias: x 2

    Under the operation Configuration: formula

    Y = (x 0 ^ 2) *(x1/x2)

    Output: Data 1 (CH1)

    THEN, WITH THE HELP OF STATISTICS:

    Input signal: data processing 1 (CH1)

    Checkbox: SUM

    Output: CH1 integral Action [has ^ 2s].


  • When I replaced a hard drive, I wanted the same drive letter, but he wants me to take another. How can I assign the drive letter, I replaced?

    When I replaced a hard drive, I wanted the same drive letter, but he wants me to take another. How can I assign the drive letter, that I replaced. The letter is now used by another device?

    Open disk management, find the drive using the drive letter you want to use, change the drive letter of this to 'Z', find the new drive, change the drive letter that you want, and then change the drive letter of the drive you have labeled it 'Z' to a drive letter of your taste.

    Jim

  • I have 3 radio button options to choose, but I want only a certain one for calculating sales tax. How can I assign a calculation to an option button?

    I have 3 radio button options to choose, but I want only a certain one for calculating sales tax. How can I assign a calculation to an option button?

    Ok. Let's say the name of the radio button group is "Radio1", the value of exports in this field is '3', the name of the subtotal is "Subtotal" and tax rate is 16%. You can use this code as the custom calculation of the tax field script:

    Event.Value = (this.getField("Radio1").valueAsString == "3")? Number (this.getField("Subtotal").valueAsString) * 0.16: 0;

  • How can I assign access to 950 members?

    How can I assign access to 950 members of the dimensions to different groups of users by using a method not GUI?

    I'm working on Hyperion Planning 11.1.2.3 and tried to attribute access for 950 members in a dimension for different groups of users.

    I tried the method of GUI (size section-> assign access->...) after 190 members I abandoned it and thought there must be a better way.

    So here's my question... y at - it another way-(prompt orders, LCM, third party utility...) - I can assign access to 950 members user group?

    Use ImportSecurity.cmd

    Import access permissions

    -Doug

  • How many people have been hired within six months of that person / after that person

    Hi all

    How many people were hired within six months of that person in oracle sql?

    How many people were hired within six months after that person in oracle sql?

    To do this, I want a query on this, can you please provide me with?

    Thank you

    Hello

    (1) how many people have been hired within six months of that person in oracle sql?

    WITH T AS (SELECT * FROM EMPLOYEES WHERE EMPLOYEE_ID = 132)

    Select E.* employees E, T where E.hire_DATE BETWEEN T.hire_date AND (ADD_MONTHS(T.HIRE_DATE,6));

    2 How many people were hired six months after that person in oracle sql?

    WITH T AS (SELECT * FROM EMPLOYEES WHERE EMPLOYEE_ID = 132)

    Select E.* employees E, T where E.hire_DATE > (ADD_MONTHS(T.HIRE_DATE,6))

    Kind regards

    Vince Kumar.R

  • How can I change my subscription within programs

    How can I change my subscription within programs

    Hello

    You will need to contact support by calling/chat for this request.

    Contact the customer service

    * Be sure to stay connected with your Adobe ID before accessing the link above *.

    Kind regards

    Sheena

  • How can I assign / manage a user in company with a student on a single account user?

    I licensed student CC for my son and a license for my work.  I am able to assign to a user on the business section, but have not found a way to affect the student son version.  Currently, when I log on my user (my desktop and my laptop) and it attempts to open its student programs on his laptop at the school, we receive a notification forcing me to close the session. It was my understanding that each license would work on 2 devices, and I bought license 2-1 student and 1 companies. How can I assign license student of my son to his own user?

    Hello

    I checked the account details and you have subscribed to two plans under your Adobe ID only.

    As you mentioned that you purchased the plan student for your son, I advise you get it canceled your account and buy under your son's account.

    You can create an Adobe Id for your son and subscribe to the terms of this.

    Please see cancel your membership creative cloud for cancellation.

    Kind regards

    Sheena

  • How to re - assign drive letters to partitions before installing XP?

    I would like to re - adversely affect permanent drive letters for the existing partitions on a hard drive that has been used for data storage only (i.e. I want to keep the partitions), then install XP.  How can I re - assign the drive letters for the partitions?

    Hello

    I just put one of my XP (bootable) disk in another one of my XP machines. The reader, before he was transferred, with C, E and Z scores. He was placed in a PC that had C and F partitions on a single drive hard but also taking over the letter E for the optical drive.

    After insertion, the partition on the changed drive letters as follows...

    C to D

    E to H

    Z to G

    Just for the acid test, while only inserted in the other PC, I changed the G (formerly Z) to Y.

    Then I replaced the drive in his PC original and started again. Partition letters were returned to what they were before the transfer took place, i.e., C, E and Z.

    What makes that to demonstrate that the drive letters do not move with a disc, they are assigned by Windows, at the time of the first detection of this particular operating system and remain like that for this particular operating system, possibly modified in another PC.

    Of this, you'll see suggestions to change the partition letter in another PC won't work.

    It seems that you have partitioning software at your disposal, so what I would suggest you do is the following.

    These instructions assume that you have an OEM installation of Windows CD, IE. not the manufacturer recovery media to perform the installation. The manufacturer recovery media is likely to format the entire disk (including all your data partitions) before installing Windows.

    Firstly back up all important data.

    Re-label all existing singlepartitions. This will help you determine what Windows Setup detects when you go through the installation of bulkheads treat.

    Secondly, to create a space at the beginning of the training, large enough for the new OS to move/resize existing partitions. Then create a new partition in this space at the beginning of the disk, label it unique and make it active. Check that it is the active partition only. Hide all other partitions, leaving the new partition at the beginning of the disc as the only visible and active partition.

    Disconnect a card reader and make sure that none of the external hard drives, memory sticks etc are attached and start the Windows installation CD.

    If all goes well, the Windows installation will see your new partition on the C drive, and you can install Windows.

    Once Windows has successfully installed you can install and use your partitioning software to display the hidden partitions. Windows should assign the letters unused in alphabetical order beginning with E (or F if you have two optical drives). You can change these letters if you want, but you have to leave within the newly created OS, and not in another PC. Your partitioning software probably has this installation or use disk management as described previously by Nithyananda J, i.e. http://support.microsoft.com/kb/307844

    Tricky

  • How do you assign at the same speed for all the notes?

    Hi all!  Can any one help with how to assign the same speed to all the notes?  I know that press "Command + A" to select all, but stay to discover how to get more than one note to change both?  Thank you!

    in piano roll, select velocity tool, cmd to select all notes, hold SHIFT-Option and drag upwards or downwards.

  • How can I assign a printer as my default when the drop-down default button does not work

    I have two printers. I can't assign one or the other as my default printer.

    my program will not allow me to print a cd label verbage. It says no default printer assigned.

    Hi Michael,

    1. were you able to set default printers before?

    2. what operating system you have installed on the computer?

    3. What is the brand and model of printers?

    Please refer to the article to learn how to set a default printer in Windows Vista and 7:

    See the articles for the respective operating systems on how to set the default printer:

    Applies to Windows XP:

    To specify your default printer

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/print_set_default_printer.mspx?mfr=true

    Applies to Windows 7:

    Change your default printer

    http://Windows.Microsoft.com/en-us/Windows7/change-your-default-printer

    Applies to Windows 8, Windows RT

    Set or change your default printer

    http://Windows.Microsoft.com/en-us/Windows-8/set-change-your-default-printer

    Please post back with more details, so that we could provide assistance on the issue.

  • How can I assign a 'C' drive to make it bootable?

    I try to install Windows XP on a disk recently wiped a update on my HP Compaq nc6400.

    (Full Specs-http://www.cnet.com/laptops/hp-compaq-nc6400-core/4507-3121_7-31851193.html)
    My main problem is that XP cannot detect any hard drives. I checked the most; the format is correct, I ran HDD via 3rd pary diagnosis and splash screen, but none of this does not work. I even tried new hard disks (none have a "C" drive), but to no avail. I can get Linux [better than nothing?] to install, so is that still confuses things.
    So, my question is: how to assign a letter 'C' on a hard drive? I can't do it through any other Windows computer because it already has a C"" drive. All solutions?
    If more details are needed, feel free to ask (note the link has all the technical characteristics of the system).

    When installing Windows XP will ask you where to install Windows. This should normally be the "Unallocated" space not partitioned / unformated drive.  Once installation is complete XP automatically assigns C: partition where XP is installed.

    As long as your drive is not formatted (not partitions or other versions of Windows installed) you should not have a problem.

    J W Stuart: http://www.pagestart.com

  • How do you assign a drive letter

    Original title: device how to assign a drive letter and or put the drive to statius online or mount a big drive to a literate player that is visible

    I have 13 terra of large drives hard and other flash drives, cards readesrs in sys I added a 3 disc terra 2ned which is not visible for terra 16 connected but its not addressable says its offline, but it is connected and 'work prpoerly' how can the system put in place to see the added disk and use the space?  a smaller drive can be removed and replaced?  or this one mounted on a different drive letter

    ?

    The provided Windows tool is disk management in the applet of the Control Panel administrative tools. Click Start-> Control Panel-> administrative tools-> management-> disk management computer.  Then locate the drive in question.  Right-click, and then click paths of access with the drive letter Change.

    If this does not work, you can try it free Easeus Partition Manager that you can download at http://easeys, com.  I got lucky with this program and Windows 7.

    I hope this helps.  Good luck.

  • How can I assign the static fixed IP for remote access VPN users

    Hi team,

    I have a requirement to assign a fixed static IP users VPN remote access in ASA, please help how I can achice this

    Thanks in advance
    Mikael

    username user1 attributes

    VPN-framed-ip-address 10.200.115.78 255.255.0.0

Maybe you are looking for

  • HP Probook 450 G2: Speakers drivers?

    I think that there is something wrong with the drivers for my speakers. They do not work for music, videos or games at all. When I adjust the sound intensity, it makes no noise. However, they perform perfectly well for Skype. I tried to change my set

  • TestStand 4.2 string not found error in the language resource files

    I installed the TestStand 4.2 on two Windows XP computers.  On a machine it worked fine first time. On the other machine, I get the following message if poster in the login box and also in the component models: ' String not found in language resource

  • Phone call, selling security software.

    original title: Please help! I want to know if computor supports (* address email is removed from the privacy * isa application services for windows because they called me on the phone and wanted to sell me a security software and I would like to kno

  • Net monitor agent works does not in Foglight

    Hi all We use 5.6.4 foglight to monitor our environment. We have the Net monitor agent for the availability of the server configured and added a few set of servers in the properties of the agent, but we do not get alerts if the server goes down even

  • problems see my drive to seagate's wireless network. used to work

    I have a seagate network drive connected to my router cisco wireless. I created the player then it should connect automatically. Initially, everything works fine. Recently, the computers on the network can seem to find the drive links which have been