Custom zoom script

I found a script by Jongware at InDesign Secrets for editing on a page and then zoom:

app.layoutWindows [0] return (ZoomOptions.FIT_PAGE);

try {app.layoutWindows [0] .zoomPercentage = number [0] (app.activeScript.name.match(/\d+/)) ;} catch (e) {};}

I modified to fit on the spread and then zoom:

app.layoutWindows [0] return (ZoomOptions.FIT_SPREAD);

try {app.layoutWindows [0] .zoomPercentage = number [0] (app.activeScript.name.match(/\d+/)) ;} catch (e) {};}

It works great for my needs if no items are selected in the spread.  However, the problem is that when an image is selected it doesn't Center the spread more.  The central point (vertically and horizontally) becomes the center of the frame or group of selected images.  Anyone know how to modify this script so that it is frame independent selection?  Thank you.

Is it not a problem with the original script? InDesign centers around the current selection zoom.

You can save the selection, delete it and then restore it later. Add at the beginning (not tested):

var oldsel = app.selection;
app.select(null);

and at the end:

app.select(oldsel);

Tags: InDesign

Similar Questions

  • I try to install an air 320u sierra wireless card and I get an error message "could not access vb run time for custom action script. Cannot install the Manager of mobile broadband services.

    could not access vb run time for custom action script

    I try to install an air 320u sierra wireless card and I get an error message "could not access vb run time for custom action script.  Cannot install the Manager of mobile broadband services.  Any ideas?

    Hello

    I suggest you run the fixit and see if it helps:

    http://support.Microsoft.com/mats/Program_Install_and_Uninstall

    Also check out this link:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-windows_programs/error-2738-could-not-access-VBScript-run-time-for/1a4499ae-8bc1-4534-9c6f-4d399ac70d9a

    It will be useful.

  • Is it possible to convert excel function if (and a custom calculation script

    Our field staff use many Excel files for project documentation.  Our organization moves for iPad instead of laptops and we found that a PDF file to be filled on-line is a great resource for our staff.  I have created several of these forms that contain multiple lines and I just starting to learn how to write custom calculation scripts.  I have a more complex than most calculation and I don't know if this can be written in script.

    = IF (I6 < 0.7, G6 * 0.8, IF (AND (I6 > = 0.7, I6 < 0.8), G6 * 0.85, IF (AND (I6 > = 0.8, I6 < 0,9), G6 * 0.9, IF (AND (I6 > = 0.9, I6 < = 1,1), G6 * 1, IF (AND (I6 > 1.1, I6 < = 1,2), G6 * 1.1, IF (AND (I6 > 1.2, I6 < = 1.3), G6 * 1.15, of"extra work"))))))

    I6 is OverdepthRow1

    G6 is WithDowelsRow1

    I think I understand how to get started

    var v1 = get.thisField("OverdepthRow1").value;

    var v2 = get.thisField("WithDowelsRow1").value;

    if(v1<0.7) {}

    var result = v2 * 0.8

    Event.Value = result}

    ElseIf (v1 > = 0, 7 - now I don't know what to do!)

    I hope that I used the correct brackets and braces in the right places.

    I appreciate your help and your advice.

    Thank you

    Rhonda

    I'm sorry, I made a mistake with the first two lines. I have corrected a problem but introduced another. They must be:

    var v1 = + getField("OverdepthRow1").value;

    var v2 = + getField("WithDowelsRow1").value;

  • If/Then converted to a custom calculation Script

    Can someone help me convert = IF (A2 - A1 > 0, 0, A1 - A2) in a customized for use in an Adobe form calculation Script?

    Thank you!

    If A1 and A2 are field names, then the custom calculation script might look like:

    (function () {}

    Get the field values as numbers

    var A1 = + getField("A1").value;

    var A2 = + getField("A2").value;

    Set the value of this field

    Event.Value = A2 - A1 > 0? 0: A2 - A1;

    })();

  • Convert the IF function in the custom calculation Script

    Can someone help me with 'IF(Line7<Line8) Line7, framework8' conversion in a custom calculation Script?

    var L7 = Number(this.getField("Line7").value);
    var L8 = Number(this.getField("Line8").value);
    event.value = (L7		   
  • Custom calculation script

    Hello

    I have some problems eiditing my custom calculation scripts.

    at present, there are: ColorField ('IncubatorLow', ValidateMinMax ('IncubatorLow', 400, 1000) & & ValidateOrder ('IncubatorLow', 'IncubatorHigh'));

    I want to change it

    If (event.value > = 400 & & event.value < = 1000) event.target.textColor = color.black;

    Else if (event.value > 1001) event.target.textColor = ["RGB", 0.5, 1, 0];

    Else if (event.value < 399) event.target.textColor = ["RGB", 0.5, 1, 0];

    But whenever I save my pdf file, it keeps the old one? Although even I tried to delete, lock and so on?

    Under java script, I can't know what is may be the course?

    Any ideas? Thanks in advance!

    Found under Java Script: ColorField runs by Custom Caluclations a string. But if I do one for example a new java script for CustomColors - and change of ColorFields to CustomColors.
    And then save the pdf file, it always uses the Colorfield?

    Just solved the problem.

    The form field name: IncubatorLow - IncubatorHigh - now, I just called them: IncubatorLowColor - IncubatorHighColor, then change the java script for validationminmax and change the colors for my 'java script' CustomColors.
    Can register with it back to the original script.

    I do not understand why change the field can solve it, but it has

  • Custom calculation script % help

    What is the custom calculation script to arrive at a percentage of penetration between two fields? Example: 50 / 100 = 50%

    The simple notation of field: field 1 / field 2

    Custom script:

    var v1 = + this.getField ("Field 1") .value;

    var v2 = + this.getField ("Field 2") .value;

    If (v2 == 0) event.value = "";

    else event.value = (v1 / v2);

  • Need help custom calculation Script

    I need to make a script are a column of fields based on or no information found in another column of fields is the same or specific text. Please find below the screenshot of what I would like that to be done.

    I would like a sum of all the amounts that had Code A...

    You can use this script as of 'SumOfA ': custom calculation script

    var total = 0;
    for (var i=0; i<=2; i++) {
        if (this.getField("p1TC."+i).value=="Code A")
            total+=Number(this.getField("p1RecIn."+i).value);
    }
    event.value = total;
    

    You can adjust easily to the other field as well.

  • Character limit to the custom calculation Script?

    Hello. I have a document that has a text form field. I want to run a custom calculation script which basically says if field 'Number group' = xxxxxxx, so the 'Group name' field should = ABC company.

    I have a list of almost 575 group numbers and names that I need to put in the script. And I have the script works fine, but I'm guessing that there is a limit of characters for the field script? It doesn't let me put my complete list in there.

    Any suggestions on how to work around this problem?

    Thank you

    Brandy

    Yes, there is a character limit for internal JS Editor. The round it is to use an external, such as Notepad.

    Do go to Edit - Preferences - JavaScript and select "Use the external JavaScript editor" and then select the application you want to use.

    Don't forget, however, that you must close the external file each time that change you it if you want to update in the PDF file.

  • Group of simple logic to operate before the custom import script?

    Hi all

    Thank you for taking the time to read my question. I gladly mark this thread as helpful or reply if you can help me. I am a novice to FDM so please keep with.

    I have a script to import custom that PKI none assigns to a specific account (substituting any detail PKI). However, now I need the detail of PKI for this account in a second statistical account. I have set up a group of simple logic to create the account of logic that I can map on statistics, but then realizes that the import script runs before the logical group so I lose all details of PKI in the account of the logic as well.

    Is it possible to repeat the logical group before importing the script or is there a better way to accomplish what I'm doing?

    I don't know how critical it is, but I'm using FDM v11.1.1.3.01 adapter 11 x-G5-C

    Published by: user4591089 on August 17, 2011 14:10

    Published by: user4591089 on August 17, 2011 14:50

    Follow these steps:

    (1) remove the custom import script.
    (2) create a complex logic account and change the dimension of the PKI in the column with the value [no PIC] group. This will be what is displayed on the screen to import on behalf of this logic.
    (3) map the original source under the statistics account and the account of logic as the case

    Published by: SH on August 18, 2011 09:48

  • Problems with the debugger in Data Modeler Beta DDL Custom Transformation Scripts

    Hello

    I use Oracle SQL Data model Beta 4.1.0.866.

    Currently, I am working on a project to generate the models in PHP for our relational database models MVC framework. Some settings must be entered from the user,

    so, I'm importing Java classes for JOptionPane in the Transformation of the customized with DDL Scripts

    var ji = new JavaImporter(java.io, java.lang, javax.swing, java.util);

    I can use these classes with no problems, but when I want to use the debugger, it cancels the execution with this error message:

    debugger_data_modeler.PNG

    Is this a bug or am I missing something here?

    And would it not possible and even preferable to processing entirely in Java instead of JavaScript scripts?

    Hello

    Try it following the syntax:

    var ji = new JavaImporter(java.io, java.lang, Packages.javax.swing, java.util);

    And would it not possible and even preferable to processing entirely in Java instead of JavaScript scripts?

    Well, it's not on the use of JavaScript, it's scripts in Java Platform - JSR 223 https://www.jcp.org/en/jsr/detail?id=223

    So if you have a JSR 223 engine of script in the JAVA virtual machine you can use your scripting language. We simply provide a setting where you can put your scripts to do something useful.

    We don't know in advance what language will be used. JavaScript engine is included in Java6 and Java7 so this is the reason why our examples are in JavaScript.

    Using Java instead of JavaScript don't make the job easier, look at the part of import here - Re: impossible to cast objects in the Script SQL DM 4.0 Transformation

    Philippe

  • Custom format script

    I hope I posted this in the right place, I am working on a form in Adobe Acrobat 9.  I have a combo box on a form, with low, medium, high and no Action required in the options.  What I want to do is to change the color of the field (text or background) based on the selection, such as

    Low - Green

    Medium - Orange

    High - red

    No Action is required - no change.

    Is this possible?

    If you mean that you want to change the background color of the drop-down list box, you can use the following custom script validate:

    Custom text field validation script

    Switch (event.value) {}

    case "Low":

    event.target.fillColor = color.green;

    break;

    case "Medium":

    event.target.fillColor = ['RGB', 1,.33, 0];

    break;

    case "High":

    event.target.fillColor = color.red;

    break;

    case study "No Action required":

    event.target.fillColor = color.white;

    break;

    }

  • Custom calculation script - default value

    Hi, I would like that the field 'A' a calculation whenever the field "B" changes its value after this 'A' becomes editable for the user. If "B" changes its value at any time, then 'A' clears any value, calculated and becomes editable for the user. As a default value.

    You must use the custom b validation script to do the math. That change in a way a field will update when the value of B, but you will still be able to manually change A. To access the value of B, in this case use event.value, for example:

    this.getField("A").value = event.value * 2;

  • Custom Zoom steps possible?

    I just got a screen of 4 k. 31.5 inches (140dpi)

    Then when I open a Photoshop of a Web site design and display 100% his watch more little then in my browser that is being enhanced.

    So in photoshop, I have about 150% zoom view them both in the same size.

    But Photoshop is that the 100% to 200% zoom step, using the shortcut CTRL +.

    So I would add 150% as an additional step fixed zoom. Is it possible somehow?

    I know it can be done manually on the lower left each time. But that takes too much time typing every time.

    (Photoshop team, please also add 150% ui maginification instead of 200%, which is too much.)

    Save the code in a text file with the extension .jsx and place the file in the Photoshop subfolder below: Presets\Scripts. Restart Photoshop and you should see the script in the file > scripts menu. Record an action and run this script. You can assign a keyboard shortcut for it.

    #target photoshop
    setZoom (150);
    
    function setZoom( zoom ) {
       cTID = function(s) { return app.charIDToTypeID(s); };
       var docRes = activeDocument.resolution;
       activeDocument.resizeImage( undefined, undefined, 72/(zoom/100), ResampleMethod.NONE );
       var desc = new ActionDescriptor();
       var ref = new ActionReference();
       ref.putEnumerated( cTID( "Mn  " ), cTID( "MnIt" ), cTID( 'PrnS' ) );
       desc.putReference( cTID( "null" ), ref );
       executeAction( cTID( "slct" ), desc, DialogModes.NO );
       activeDocument.resizeImage( undefined, undefined, docRes, ResampleMethod.NONE );
    }
    
  • Import the custom calculation Script

    I have a purchase order General Im is about to build. I have a lot of subtotal fields needing a custom on them calculation script.

    Is it possible to load a script (XML / import data) in all my fields desired with the appropriate script?

    Or is there little javascript that allows to calculate per line?

    Sample:

    https://DL.dropboxusercontent.com/u/2944617/sample.PDF

    CAL script:

    Event.Value = (this.getField("__PRICE-01__").value * this.getField("__QTY-01__").value);

    If (+ event.value = 0) event.value = "";

    You can use a script to set calculation script custom field, like this:

    this.getField("FieldName").setAction ("calculate", "code as string");

Maybe you are looking for