How can I resize in pixels in action

Hello

I have a question about the resizing of an image and do it in an action.

For example: I have an image that is the width of 500px and 500px high. Now I place a new image in this picture, but this new image is 700px width and high 746px (I know that the new image is not square, but it doesn't for that matter). I can resize this new 500x500px image by using the TRANSFORM option. No problem.

But now I want to use it for 100 images. I so want to do this action. The problem is now is when I recorded this action, the action does not transform the newly placed at 500x500px image but he uses a "percentage". Say so I placed (during the recording of this action) a new image 1000 x 1000 px action saves it as to transform the new image to 50%. But when I want to use the action of an image whose size is 700 x 746 px, the result of the action is that the new image is transformed into 350 x 373 px (which is 50%).

So my question is, how do I create an action that does not use the percentages, but instead uses pixels.

Thanks in advance for any help.

This should be centered layer.

#target photoshop;
app.bringToFront();

main();
function main(){
if(!documents.length) return;
try{
var doc = app.activeDocument;
app.displayDialogs = DialogModes.NO;
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
activeDocument.activeLayer.resize(100 ,100,AnchorPosition.MIDDLECENTER);
var LB = doc.activeLayer.bounds;
var LWidth = LB[2].value - LB[0].value;
var LHeight = LB[3].value - LB[1].value;
var X = (100 / LWidth) * 500 ;
var Y = (100 / LHeight) * 500;
activeDocument.activeLayer.resize(X,Y,AnchorPosition.MIDDLECENTER);
activeDocument.selection.selectAll();
align( 'AdCH');
align('AdCV');
activeDocument.selection.deselect();
}catch(e){}
finally{
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
    };
};
function align(method){
   // 'AdCH' - center horizontal
   // 'AdCV' - center vertical
   // 'AdLf' - left
   //  'AdRg' - Right
   // 'AdBt' - bottom
   //  'AdTp' - Top
   var desc = new ActionDescriptor();
           var ref = new ActionReference();
           ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
       desc.putReference( charIDToTypeID( "null" ), ref );
       desc.putEnumerated( charIDToTypeID( "Usng" ), charIDToTypeID( "ADSt" ), charIDToTypeID( method ) );
   executeAction( charIDToTypeID( "Algn" ), desc, DialogModes.NO );
};

Tags: Photoshop

Similar Questions

  • How can I resize my tool icons and info bar. It is too small for me to see the good

    How can I resize my tool icons and info bar. It is too small for me to see the good

    Hi nonnoni,

    In Illustrator CC 17.1 update, Illustrator user interface can be resized to 150% and 200%. It is triggerred when you change your screen from Control Panel > 125% scaling and your monitor supports a minimum vertical resolution of 1080 pixels.

    Sanjay.

  • How can I change the pixels for photos on the iphone 6? IOS 9.1

    How can I change the pixel for photo taken on my iphone 6? 9.1 IOS I opened the camera and there only HDR power...  Help, please!

    You do not change the pixel setting.

  • How can I resize a picture using Picture Manager please?

    How can I resize picture using Picture Manager please? Let's say I want to put 4 x 6 cm for a given photo dimensions. I tried to resize , but is it compresses the picture to send by e-mail etc... It is basically a photo compressor.

    How can I resize picture using Picture Manager please? Let's say I want to put 4 x 6 cm for a given photo dimensions. I tried to resize , but is it compresses the picture to send by e-mail etc... It is basically a photo compressor.

    =============================
    If you are running Windows XP... it is a free software
    The PowerToy that is useful for resizing of the pictures:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Go to the following link and download and
    install: ImageResizer.exe
    http://www.Microsoft.com/windowsxp/downloads/PowerToys/xppowertoys.mspx
    (does not work on Vista)

    Then, you can open any folder containing
    images and you will have an option to resize.
    Just right click the selected image files and
    Choose resize images in the menu. You
    can select a picture or an entire group.

    The program will place the resized in copies
    the folder with your originals.
    (Tip: * never * overwrite your originals)

    To ensure that images in both portrait and
    landscape orientation are resized to the
    same dimensions... go to... Advanced...
    and enter the largest number in these two areas.
    IOW... for 600 x 800... Enter 800 in these two areas.

    (Tip: even if you resize the Photos to the same)
    dimensions (original)... the file size will be greatly
    reduced).

    =====

    If you want to change the proportions of a picture...
    you have to reframe it... otherwise it will be distorted.

    The following freeware has a tool of good harvest.
    Just select a thumbnail and press X to open the
    Council for culture. (Tip: always save your editing / cropped /)
    photos resized under a new name)

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    FastStone Image Viewer
    http://www.FastStone.org/FSViewerDetail.htm

    The following tutorial provides information on the creation of a
    2 "x 2" photo ID, but the steps would be
    basically the same for any size.

    Now, open the program and select (highlight)
    the image you want to change.

    According to... to... Edit / crop Panel (or type... (X)

    Click on the button 'Set Ratios of paper'.
    (it's just to the right of the proportion of paper
    fall of window)

    Click on the 'Add' button and enter... 2 x 2 "
    Click on... OK / OKAY... (this will give you the square
    format you need)

    You can resize the selection frame by dragging
    reposition by dragging corner handles
    the arrow of the 4 channels. At the end... Click on the 'culture '.
    button.

    Now... to... File / save as...
    Choose a backup location, enter a new name for
    the photo and choose a format to save in...
    Left click on the Save"" button.

    =====

    Info about photo manager
    If you resize a photo with Picture Manager and
    save it when you see the dialog box saying:

    "There are changes that have not been saved"

    The original photo will be overwritten (replaced)
    with the rezized version... IOW the original will
    be unrecoverable.

    To keep two versions of the picture, resize it
    and go... File / save as... Enter a new name for
    version resized and on the left, click on the "Save" button.

    When you close the photo manager and see the
    dialog box:

    "There are changes that have not been saved"

    On the left, click the do not save"" button. Now
    have both versions.

    Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • How can I resize a digital image using software of photo gallery to keep my digital images to be cut during printing on standard paper by a commercial processor? MP

    How can I resize a digital image using software of photo gallery to keep my digital images to be cut during printing on standard paper by a commercial processor? MP

    How can I resize a digital image using software of photo gallery to keep my digital images to be cut during printing on standard paper by a commercial processor? MP

    ====================================
    Sometimes the only resizing is not the answer because the
    the original size is different from the print size.

    You may need to crop photos to the size you want
    print to ensure that no clipping will occur. Cropping
    to a different aspect ratio will lose some parts of the picture but
    at least you have control over it.

    Windows Live Photo Gallery is a cropping tool.

    Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • How can I resize window "script event handler?

    How can I resize window "script event handler? (I entered in a script long as event handler script. After adding the script, I can't view or scroll key buttons on the right) .attached is a screenshot of the problem I am facing.a.jpg

    Quit photoshop and go to

    For Photoshop CS6

    Photoshop CS6 Photoshop C:\Users\Your Name\AppData\Roaming\Adobe\Adobe CS6\Adobe settings

    For Photoshop CC

    C:\Users\Your Name\AppData\Roaming\Adobe\Adobe Photoshop CS6\Adobe Photoshop CC settings

    remove the

    Script Manager.xml events

    then restart photoshop


    I think that the events are for something like select menu or tool (filter), and then this, for example.

    For your script, probably add using skip under Script would be preferable.



  • How can I resize a shape tween without that he's looking wonky?

    Hello! I am a beginner in flash animation, although I used it to draw several years before.

    I have a problem that I can't find the answer to the simple. I looked in many places.

    in any case, I have a scene to its default size to 550px x 400px. I thought it would be easy to change later if I don't bother making it larger at the beginning. Now that my drawing is completed, I want to make the biggest scene (of 1024px x 768px) AND stretch the graphics / content on the stage as well as the well adapted to the larger stage. And I want it centered too because it is aligned to the left now when I preview it in my browser. It would be a piece of cake, if I didn't have a shape tween that looks to wind blowing hair in!

    The dilemma is that when I resize the graphic, the shape tween ends as a result of these movements, thinking that it is the part of the animation when it is not supposed to be. My question is how can I resize a shape tween without keyframes following the movements that I do? I want just a larger version of the shape tween, I already have put in place and don't want more bigger / change of position to be part of the animation!

    Help, please. Thank you!

    One of those three things should work:

    1. Try to click the key next to the stage width and height and enter your new width and height, then clicking on 'Scale content with scene.'
    2. In your publishing settings, select "percent" and a percentage higher than 100.
    3. Follow the steps here http://flashthusiast.com/2009/10/06/scaling-and-moving-new-motion-tweens-in-flash-cs4/

    Good luck!

  • How can I insert html into the Actions Panel to format text?

    I am trying to create text using html, so I could format it in html.  I created a text box, it has given an instance name, "Dynamic text" selected and clicked 'display the text in html format.  When I click F9 (go on the Panel shares) to insert my html code, I get the message "current selection cannot have actions applied to it.  Am I missing something?  How can I insert html into the Actions Panel to format text?

    In order to assign html text to a textfield, you must assign your htmlText of a textfield property.  If you must give a name of uinstance to the textfield and then assign the text.  If you named the "tField" textfield, in the scenario that contains the textfield you EF text html as follows...

    tField.htmlText ="

    your text

    ";

    You should watch the TextFields htmlText property in the help documents to determine the limited number of html tags that are supported by Flash.

  • How can I change the list of actions that appear when you right-click on a file?

    When you place your cursor over a file, then right click, you get a pop-up window with a list of actions that you can do in the file. Depending on the type of file, you get a different list of actions. How can I change this list. Or add or subtract from the it. Where Windows keeps related lists?

    In Windows Explorer, remove it all also missing button?
    Try to restore the files ZIP file association.

    For Windows Vista file association problems
    http://www.Winhelponline.com/articles/105/1/file-association-fixes-for-Windows-Vista.html

    Make a right click on the zip link, save target under... Right click on the REG file and choose merge. Note that you must be an administrator to apply these fixes.

  • How can I remove the pixels in Photoshop Elements?

    I changed settings a while back so I could try to create a few SNES, but now I don't remember how it go back to its settings beforehand. It is increadibly difficult to use Photoshop when these pixels are in the way. How can I get rid of them?

    https://i.imgur.com/6rE64Tf.PNG

    Do you mean the grid lines?

    If so, go to view and click on grid

    View > grid

  • How can I insert a video and how can I resize with Dreamweaver cs5?

    I export a slide show on a Web page. The format will be H.264. But I had problems with the integration of the video using Dreamweaver cs5, then, what are the best measures? Also, I need to make the video smaller than the standard size, so how do I resize as well? Thank you!-Peter Mayer

    Use the HTML5 video tag. You will need to manually code if ' cuz CS5 has no menus for it.  No, they were introduced in DW to the creative cloud CS6 (ver 12.20).

    HTML5 video

    If you want sensitive videos, see my Bootstrap tutorial.

    ALT-Web Design & Publishing: reactive Bootstrap 3 Videos

    Nancy O.

  • How can I resize my logo to 45 pixels?

    I have a normal image, but I don't know how to resize using measures such as pixels. Help!

    If you right-click on the intersection of the horizontal and vertical rules in the upper left corner of your window of Illustrator, you can select Pixels for your units. Then, using the range of information as your guide, you can either eyeball it while you resize, or use a little math to size your image an exact percentage.

  • How can I resize my image, 750 x 750 pixels with 2.5 inches of width and the size of document height 2.5

    Without getting the distorted image.

    You would need to use the crop tool and set it to this size.

  • How can I resize an iframe in apex based on the amount of available space on the screen with a button

    Hello.  I have a request to 4.2.2.00.11, llg Server Oracle apex.  The conditions for this application are to hide and display a navigation bar by clicking on the buttons leathers/display on the screen.  The right side of the screen has an iframe that is to fill up whats left of the estate of the web browser.  Search in google, I found a function that works on the laundry.  I need the iframe to resize when the browser hides and shows, but when I tried to create a dynamic action on click to call javascript, hide and show the features of the browser bar break.  The iframe is not also resize.

    Here's the code that I currently use.

    JavaScript in my page header

    <script language="JavaScript">
    <!--
    function autoResize(id){
        var newheight;
        var newwidth;
    
    
        if(document.getElementById){
            newheight=document.getElementById(id).contentWindow.document.body.scrollHeight;
            newwidth=document.getElementById(id).contentWindow.document.body.scrollWidth;
        }
    
    
        document.getElementById(id).height= (newheight) + "px";
        document.getElementById(id).width= (newwidth) + "px";
    }
    //-->
    </script>
    
    

    The source of the IFRAME area.

    < IFRAME SRC = "f? p = & I_FRAME_APEX_APP_ID: & I_FRAME_APEX_PAGE_ID.: & APP_SESSION.

    : NO::ROLE: & ROLE. "width ="100% "height ="200px"id ="iframe1"marginheight ="0"frameborder ="0"onLoad ="autoResize ('iframe1'); "> < / iframe >

    A colleague suggested this, and the width is now set properly.  the height is always not to fit properly in the window.  When I set the height to 100%, the default height for pixels, I put in the iframe.

    
    
    
  • How can I remove excess pixels around my SWF in HTML window?

    When I publish my project Captivate (version 5.5) with HTML, the SWF is padded by a few low high pixels to the right and to the left. Because places are critical, I would remove this fill.

    I read in a blog somewhere that this can be done by CSS. Can someone tell me how?

    Here's the HTML standard I'm occurs by Captivate:

    < body bgcolor = "#f5f4f1" >

    < center >

    < div id = "CaptivateContent" >

    < / div >

    < script type = "text/javascript" >

    var so = new SWFObject ("TestDemo.swf", "Captivate", "1224", "840", "10", "#CCCCCC");

    so.addParam ("quality", "high");

    so.addParam ("name", "Captivate");

    so.addParam ("id", "Captivate");

    so.addParam ("wmode", "window");

    so.addParam ("bgcolor", "#f5f4f1");

    so.addParam ("menu", "false");

    so.addVariable ("variable1", "Value1");

    so.setAttribute ("redirectUrl", "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash");

    so. Write ("CaptivateContent");

    < /script >

    < script type = "text/javascript" >

    document.getElementById('Captivate').focus ();

    document. Captivate.Focus ();

    < /script >

    < /Center >

    < / body >

    < / html >

    Thanks for any help

    In the region of the HEAD of the HTM pattern, add this code:

Maybe you are looking for