subtract, divide into a single custom script calc

I am very new to all this and have created a custom with the help of this community script.  I try to get the percentage increase, when a person gets a pay rise...

My fields are Pay1 = old rate, funds2 = new rate, payer3 = amount of increase and Pay4 percentage increase.

I have the script below in the Pay4 fields:

var P1 = Number (this.getField("Pay1").value);

var P2 = Number (this.getField("Pay2").value);

If (P1 = 0) {P1 = 1}

If (P2 = 0) {P2 = 1}

var P3R = P1/P2 * 100;

var PERC3NT = 100 - P3R;

PERC3NT = PERC3NT / 100;

this.getField("Pay4").value = PERC3NT;

I noticed that if I replace "funds2' with 'Payer3' I get a smaller amount as the percentage.  I know I need to divide the difference of the old rate increased and the time by 100 to get the percentage.  I seem to be missing something because even when I change the rate to a dollar more my percentage does not seem fair.  Can help you.

This is because you need to divide the new salary of old, not the other way around.

I think that this code should work fine:

var P1 = Number (this.getField("Pay1").value);

var P2 = Number (this.getField("Pay2").value);

If (P1 == 0 |) P2 == 0) {event.value = ""}

else event.value = ((P2/P1)-1) * 100;

Tags: Acrobat

Similar Questions

  • Divided into a single column

    Hello

    I need to split into single column in the format below:

    SELECT '6500,1100,3200,1233,9000' FROM DUAL;

    Result:

    6500

    1100

    3200

    1233

    9000

    For 11g and above:

    Select regexp_substr (6500, 1100, 3200, 1233, 9000', ' [^,] +', 1, level) suite

    of the double

    connect by level<= regexp_count('6500,1100,3200,1233,9000',="" ',')="" +="">

    For 10g:

    Select regexp_substr (6500, 1100, 3200, 1233, 9000', ' [^,] +', 1, level) suite

    of the double

    connect by level<= length="" (regexp_replace="" ('6500,1100,3200,1233,9000',="" '[^,]+'))="" +="">

    or (if there is no empty entries):

    Select regexp_substr (6500, 1100, 3200, 1233, 9000', ' [^,] +', 1, level) suite

    of the double

    connect regexp_substr (6500, 1100, 3200, 1233, 9000', ' [^,] +', 1, level) is not null

    RESULT
    6500
    1100
    3200
    1233
    9000

    5 selected lines.

  • Is it possible to merge images of 4 different files into a single image of 4 x 4 with ps scripting?

    I have therefore four files that each contain 970 images.   The pictures in the folder 1 are exactly the same as the images in the folder 2, 3 and 4.   All images are also in size 400px.   What I'm trying to do is to take images of the same name of each of the 4 files and put them into a single image of 800 x 800, then they are arranged in a 4 x 4 mode.

    Example: Each folder has an image named mastiff1.psd.  Images of four mastiff are different, but have the same name and have the same size.  I wish that all the images of four mastiff to be combined into a single image to double size who has all four images mastiff on it and save it as mastiff1 - 4 x 4.

    Is that something this photoshop script could do?  I'm a newb to this.  I used actions much, but never a script.

    For the script, you need to know a programming language JavaScript script that works on both platforms of Photoshop or AppleScript which will be only the Apple Mac machines, VSbasic or that will run only on windows.  You should also know how Photoshop and know how to use Photoshop well.

    There are some things that cannot be scripted to DOM Adobe doesn't have the methods of the interfaces for all of the functionality of Photoshop.  However, there is a plug-in with Adobe name Scriptlistener witch is as a recorder of script that you do in Photoshop that can be recorded in actions is recorded in two papers on the desktop you when the Scriptlistener plugin is installed is in the JavaScript syntax in VSbasic.   As Actions there is no logic just hard coded step, step, step...  The code uses the Operations Manager to do the function of Photoshop.  If the things that cannot be scripted using Adobe DOM can be scripted by using the action handler code produced by the Scriptlistener plug-in and hard-coded steps can be changes in javascript functions that use variables.

    According to me, what do you think would be a real ambitious first Photoshop script.  Adobe script documentation, the example script and Scriptlistener are not part of the standard installation. You need to download these from Adobe. Adobe Photoshop scripts. Adobe Developer Connection.

    I don't really know javascript, but I can hack it. Did some scripts in the document layout.  Most require a PSD template but PasteImageRoll does not work, but any Image must be in the same folder.  Most of my automated script require any image to be in the same folder.  However, two of my scripts are interactive.  You can select each image available from anywhere.  Images will be automatically resized and positioned to which you can then edit.

    I'm not the best eaten encoder, you can always look at the code I came with.

    Script to roll stick Image and picture package Support

    Image Collage Kit getting up-to-date made turn to Best Fit an option in PasteImageRoll.jsx change to customize your default settings.

    Scripts for Photoshop is powerful and I think that this package demonstrates this.

    The package includes four simple rules to follow to make Photo Collage Template PSD files so they will be compatible with my Photoshop scripts.

    There are twelve scripts in this package, they provide the following functions:

    1. TestCollageTemplate.jsx - used to test a model of Collage of Photo while you're doing it with Photoshop.
    2. CollageTemplateBuilder.jsx - can build models that are compatible with this toolkit scripts.
    3. LayerToAlphaChan.jsx - used to convert a stack of the Prototype Image layers in a document template.
    4. InteractivePopulateCollage.jsx - used to fill interactively model Any Photo Collage. Offers more user control insert images and text.
    5. ReplaceCollageImage.jsx - allows to replace an object layer dynamic image collage populated with another image resized and positioned correctly.
    6. ChangeTextSize.jsx - this script can be used to change the size of text Image stamps when the size used by the filling did not work well.
    7. PopulateCollageTemplate.jsx - used to fill a Photo Collage template and leave the populated copy automatically opened in Photoshop.
    8. BatchOneImageCollage.jsx - used for the models automatically batch fill Collage that have only a single image inserted. The Collage or picture may be stamped with the text.
    9. BatchMultiImageCollage.jsx - used to model automatically batch fill any Photo Collage with images in an image source folder. Easier to use than the interactive script. Recorded collages can be twisted.
    10. BatchPicturePackage.jsx - used to model automatically batch fill any Photo Collage with an image in the image source folder
    11. PasteImageRoll.jsx - paste Images into a document to print on roll paper.
    12. PCTpreferences.jsx - edit this file to customize Collage fill preset scripts and add your own layer styles.

    Documentation and examples

  • Why the hard disk is divided into partitions of two data (C:Vista and E: Data)?

    I just started a new A200-1V0 and found that disk space is divided into two partitions of sizes equal 'C:Vista' and ' E: Data "(and a small one EISA).

    WHY? What is the logic and purpose? It's not even as if the C:Vista partition is smaller and intended only to the tricks of the 'system' as the root 'Users' (user Documents) is on it also.

    This is the default for Vista (my first use of it), if not, who said that Toshiba could do this without asking me?

    How can I move the root 'Users' in Vista (in the data partition) - if I have two partitions that I might as well use it?

    I can resize partitions in Vista without a utility 3 rd-party (or a complete backup/restore)?

    Thank you

    Hello just YOU

    Please don't be offended because there is no reason for this. You bought the new product with the factory settings. Toshiba and other hardware manufacturer do not know every customer personally and, unfortunately, it was not possible to ask YOU how to set up YOUR laptop.

    Because of this, there is a recovery of product support that allows to configure the HARD disk according to your wishes and needs.

    Please use this DVD and install OS how you want it to be. What recovery procedure starts, you will see CONFIGURATION option on the right side. Click on it and choose the right option.

    Reinstall the OS and enjoy your life. Really, I don't have the time to write on the floors of two partitions, because this is basic stuff and you probably don't want to waste your time to read this.

    Bye and good luck!

  • How can I create a screen divided into movie maker?

    original title: Director - split screen

    How can I create a screen divided into movie maker?  I have a video of the presenter and a PowerPoint presentation and would like to show on the screen in the film.

    You need a custom... transition may be the
    the following link would be a place to start.

    Split video Transition
    http://www.windowsmoviemakers.NET/forums/ShowPost.aspx?PostID=200548

    Maybe the next Movie Maker Forum
    would provide more information:

    Movie Makers Forums
    http://www.windowsmoviemakers.NET/forums/

  • Combining images into two separate postscript files into a single file with a single line

    I have two postscript files, each representing a pure black and white, images identically companies (generated by Eagle PCB, is not that it's all that relevant), as it is attached.   I would like to combine the two files into a single file where are the two images side fits on one line so I can print them together.   What is the easiest to do this route?

    Example files:

    https://www.dropbox.com/s/rrcw4t4bk0x5x6u/file1.PS?DL=0

    https://www.dropbox.com/s/21de4f9c35qa3w3/File2.PS?DL=0

    In fact, I could solve the problem with a little reverse engineering of the Postscript and a bash script.

    The files two postscript define a bunch of common functions and some points of reference and call these functions to draw geometries.  I just extend the width of a drawing by 2 X, remove the "grestore" from the bottom, translate the origin back to the middle and shoot another image, followed by a "grestore.

    Resulting file:

    https://www.dropbox.com/s/p378o2vtppl6v1y/combined.PS?DL=0

  • combine multiple files into a single

    Hi all

    Request:

    1. the need to combine several files into a single

    2. the user already created destination doc

    3 folder contains about 30 files (all files having 1 page only)

    4. the need for a

    Script:

    1. to receive the forum script (combine multiple documents)

    2. using the forum script, the output comes wrongly (comes side by side)

    Fault output using the script below:

    Screen Shot 2015-05-31 at 8.05.38 PM.png

    Power required:

    Screen Shot 2015-05-31 at 8.08.48 PM.png

    Slightly modified:

    #target indesign
    // set the destination document as the active document.
    var destination_doc = app.activeDocument;
    destination_doc.documentPreferences.allowPageShuffle = true;  
    destination_doc.spreads[-1].allowPageShuffle = true;  
    
    // select the source folder
    var sourceFolder = Folder.selectDialog("Select a folder with source InDesign files.");
    var fileList = sourceFolder.getFiles();
    fileList.sort();
    
    for ( var i = 0; i < fileList.length; i++ ) {
        var source_file = fileList[i];
        
        if ( source_file instanceof File && source_file.name.match(/\.indd$/i)) {
            app.open(source_file);
            var source_doc = app.open(source_file);  
            var sourcePages = app.activeDocument.pages.item(0);
            sourcePages.duplicate(LocationOptions.AFTER, source_doc.pages.item(0));
            sourcePages.move(LocationOptions.AFTER, destination_doc.pages.item(-1));
            app.activeDocument.close(SaveOptions.NO);
        }
    }
    

    Thanks in advance

    Siraj

    Hello

    You should duplicate/move a spread instead of a page.

    Try simply change around L18 - 20 as below.

            var source_doc = app.open(source_file);
            var sourceSpreads = app.activeDocument.spreads.item(0);
            sourceSpreads.duplicate(LocationOptions.AFTER, source_doc.spreads.item(0));
            sourceSpreads.move(LocationOptions.AFTER, destination_doc.spreads.item(-1));
            app.activeDocument.close(SaveOptions.NO);
    

    Thank you

  • Need to the tab of each document (Word or PDF) being converted/combined into a single PDF file. Only have an online account. Is this possible online

    Need to the tab of each document (Word or PDF) being converted/combined into a single PDF file. Only have an online account. Is this possible online?

    Hi pjj,.

    When you open the Bookmarks pane (the second icon from the top in the column the leftmost in Acrobat), you will see a bookmark for each file that has been attached to create the PDF. If you have created the combined file from Acrobat.com, however, file names are changed, it won't be as easy to say what are the components. If you create the file in Acrobat, then bookmarks retain the name of the original file, so your customer will be able to tell at a glance if everything was included.

    Best,

    Sara

  • Convert different types of files and merges them into a single pdf

    Hello world. I'm a girl from China.

    There is folder containing files of different types, such as doc, msg, jpeg etc. severl.   And I want to convert and merge them into a single pdf according to a certain order. I know that PDFmaker can do well, but the problem is that I have like fodlders 3000 + which requires the same work.

    I want to do with VBA and Acrobat. I have a Standard Version of Acrobat XI and a perfect license, by the way

    And I got the code (thanks, Karl Heinz Kremer) from the merger of two files into a single PDF, but how can I convert them to pdf first?

    Thank you very much.

    If I can finish, I would like to publish my code on this forum.

    You must upgrade to Acrobat Pro. Then, you would be able to use an Action to convert all the files in your file (s) to PDF format and later on another Action (+ script) to combine them into a single PDF file. So basically, it's a 3 step process. Is not ideal, but not too hard, either.

  • Is there a way to keep the original properties of several PDF when merging into a single document?

    I have over 200 PDF documents that I need to keep in reversed chronological order, but when I merge them into a single PDF, they are in alphabetical order and show the update the [current date].  In my profession (law), I have to combine these several PDF in a single document and must be in reverse chronological order.

    You can determine the order in which the files are merged (manually, or)

    with a script), but a file can have only one value under the modified

    Date property...

  • Merge multiple images into a single file

    Hi all

    I am writing because I need to merge multiple images into a single file and do not know how.

    I need to create a large table with several aerial photographs, so I didn't need to create a panorama, but I would like to use an automatic procedure to merge the images because they are many.

    Can you help me??

    I tried photomerge but it creates more levels without ordering the photos...

    If all the files are the same size, there is a script "File Stitcher" @ http://www.ps-bridge-scripts.talktalk.net/

  • TIFF of Import Options - flatten the layers into a single Image

    Hi all

    Running a script to open the files and convert them into another type. When it comes to a TIFF file type, called 'TIFF Import Options' dialog box opens. This window has a column of Options containing two pieces of music radio to "Convert layers to objects" and "flatten into a single Image. How to open the file with the whole "flatten the layers into a single image?

    Thank you

    OpenOptionsPhotoshop.preserveLayers = true;

  • Cannot sort bookmarks; they are divided into two groups

    I am trying to sort the bookmarks in the bookmarks Menu by name. They seem to be divided into two groups with no demarcation between them. The first group ends with "Windows"; the second group starts with 'test ideas '. In the list in the bookmarks Menu, "Essay Ideas," comes just after "Windows". Right click on the bookmarks Menu and choose sort by name doesn't fix this.

    There are separators between these two groups?

    Can drag you these bookmarks manually in the order you want?

  • HP Pavilion dv6: screen divided into 4

    Please, the machine restarted when I got a BSOD whith the memory management code, after having resolved, my HP logo divided into 2 a top and a bottom, but is returned to normal, it does this for about a week and this time, he does not return to normal

    so I started at the login screen and I saw that it was 4 with 2 vertical on the right full screens and 2 screens of half verical on the left

    so I reinstalled windows, but to no avail.

    I've also updated my drivers buht

    I connected to an external monitor, it looks perfect

    Name of the OS Microsoft Windows 10 Pro

    Version 10.0.10240 Build 10240

    Another Description of the OS is not available

    Manufacturer of operating system Microsoft Corporation

    Name of system OFFICE-ACO8E6T

    System manufacturer Hewlett-Packard

    HP Pavilion dv6 Notebook PC model system

    X 64 PC system SKU C2Y45AAR is of Type #ABA

    Processor Intel Core i7-3630QM CPU @ 2.40 GHz, 2401 Mhz, 4 Lossnay 8 logical processors

    BIOS Version/Date Insyde F.26, 03/04/2013

    SMBIOS Version 2.7

    Embedded Controller Version 52.24

    UEFI BIOS mode

    Baseboard manufacturer Hewlett-Packard

    Model baseboard is not available

    Name of plinth base

    Role Mobile platform

    Start secure State

    PCR7 Configuration binding is not Possible

    Windows directory C:\Windows

    System directory C:\Windows\system32

    Boot Device \Device\HarddiskVolume2

    The local United States

    Hardware Abstraction Layer Version = "10.0.10240.16392".

    User name of OFFICE-ACO8E6T\LIVINGSTONE

    Time zone Pacific Daylight Time

    Physical memory (RAM) installed 8.00 GB

    7.89 GB total physical memory

    5.57 GB available physical memory

    9,77 GB total virtual memory

    7.42 GB available virtual memory

    Pagefile 1.88 GB of space

    Paging file C:\pagefile.sys

    Hyper-V - VM monitor Mode Extensions Yes

    Hyper-V - second level address translation Extensions Yes

    Hyper-V - virtualization enabled in Firmware Yes

    Hyper-V - data execution Protection Yes

    Hi @OPTIMISTICSTONE,

    Thank you for joining the HP Forums!

    I noticed your post on how your screen divided into 4 with your HP Pavilion dv6 Notebook. I'm happy to help you!

    What is the number of product/model of your HP Pavilion dv6? How can I find my model number, serial number or product? There are several versions, example: HP Pavilion dv6500.

    For now, maybe the steps described in this guide will help. Solve the problems when switch between views using FN + F4.

    Don't forget to come back to this thread and check "Accept as Solution", if I have successfully helped solve you the problem. If you want to say 'Thank you' to my effort to help, click on the "thumbs up" to give me a Kudos.

    I hope this guide to solve your problem!

  • Music not be divided into albums

    I use Windows 10 and have downloaded the music that has been added to my downloads.

    When I try to drag and drop my downloads from I tunes 12.3.3.17 it adds everything but not in their designated just CD all in the form of numbers, for example: 111222333444.

    Is there anyway I can change this so it gets divided into their designated CD?

    Thanks in advance

    You have all the CD in a folder?  If I read this article of law:

    12 iTunes for Windows: importing music and video already on your computer

    You must create a folder for each CD and then import (or drag-and - drop) each CD separately.

Maybe you are looking for