Have a layer resizing script, but need to work when the layer is great than 550px

Hello

Fortunately, I found a script that does a layer resizing just what he needed. Only thing is, I want the script to deploy only if the current layer is more than 550px - existing code for the script is less to:

(function (){
    var startRulerUnits = app.preferences.rulerUnits;  
    app.preferences.rulerUnits = Units.PIXELS;
    var bounds = activeDocument.activeLayer.bounds;  
    var width = bounds[2].value - bounds[0].value;
    var newSize = (100 / width) * 550;  
    activeDocument.activeLayer.resize(newSize, newSize, AnchorPosition.BOTTOMLEFT);
    app.preferences.rulerUnits = startRulerUnits;  
})();

If anyone can explain how I can use an If works, would be much appreciated!

Thank you very much in anticipation.

(function () {}
    var startRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var limit = activeDocument.activeLayer.bounds;
    var width = limits [2] .value - limits [0] .value;
    If {(width > 550)
    newSize = var (100 / width) * 550;
    activeDocument.activeLayer.resize (newSize, newSize, AnchorPosition.BOTTOMLEFT);
    }
    app.preferences.rulerUnits = startRulerUnits;
})();

Tags: Photoshop

Similar Questions

  • I have a power shot sx 40 & need to know: when the top to magnify a picture how save you it to your camera?

    I have a power shot 40 & I learned how to make a zoom in / maginfy a pic, but I cannot find a way to save the image maginfied.

    Thank you ~.

    Im not sure what you mean, but if you mean when you zoom in on a photo in playback mode, it is a way to save the area zoomed separately from the original photo on the camera.

    To start the Cup select in the playback menu.

    The Zoom lever allows you to resize the image and you can press the dots on the adjustment wheel to move the frame also.

    You can also press the Disp to change orientation.

    When you are finished, press Set and it will ask you to save a new Image, click Ok.

    Press Menu and when your promtped to the new display picture select Yes or no.

    You can consider a book written especially for your SX40. I own the SX50 and bought this book because a large part of it still applies. It is called A Short Course in Canon Powershot HS SX40 photography written by Dennis P. Curtin.

    The procedure I just tell you it came from this book which is clearer than the way I have described mysef

  • I have a bar chart and I need to completely remove the axis labels

    I have a bar chart, and I need to completely remove the axis labels and have only black 1px on the axis lines.

    I tried this in style but the font-size: 0; doesn't labels disappear completely.

    BarChart {}
    horizontalAxisStyleName:myAxisStyles;
    verticalAxisStyleName:myAxisStyles;
    }

    {.myAxisStyles}
    tickPlacement: none;
    do-size: 0;
    }

    Try adding a verticalAxisRenderer and a horizontalAxisRenderer between your tags barChart.

    That is to say.

    ....

    ...

    The key is in setting showLabels property to false.

    J

  • I have HTC HTC ChaCha A810e but not picked up at the Nepal

    I have HTC HTC ChaCha A810e but not picked up at the Nepal.

    James,

    We have actually official ARMv6 builds now available for download: http://nightly.mozilla.org (select the download option ARMv6 downstairs in the Android category).

  • Here's a strange. I have a HTML page with this time a wmv video. It works perfectly from a USB stick or SD card, but does not work when they are copied to the hard drive

    I have an HTML page created with web expression 4. It contains only a wmv video. It works perfectly when it is called from a USB stick or SD card, but does not work when they are copied to the hard drive. The results are the same with IE and Firefox. It don't make no difference if I use Media Player V9 or V11. He has no control on the page Media Player. Video and html files are in the same directory. Here is the code snippet:

    LIFT, DRAG, THRUST and GRAVITY










    If I run it on a machine with Win 7 there is no problem.

    Richard Grosser

    Hi Richard c. Grosser,.

    Your question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the Microsoft Expression forums.

    http://social.expression.Microsoft.com/forums/en-us/categories

  • I created a Javascript script that adds a watermark on the document action "paper print".  This works in Acrobat Pro, but does not work in the drive.

    I created a Javascript script that adds a watermark on the document action "paper print".  This works in Acrobat Pro, but does not work in the drive.  I am a novice using Javascript, so what am I doing wrong?

    Cannot use either addWatermarkFromFile or addWatermarkFromText methods of document with player as shown in the documentation. You can hide/display the form fields and the existing layers, so consider this approach.

  • A3 landscape artboard. When the zoom is less than 100%. the appearance of the work (lines) in staircase, I can tell this resolution because something I have to zoom and it disappears. I understand the difference between vector and raster as well... looks

    A3 landscape artboard. When the zoom is less than 100%. the appearance of the work (lines) in staircase, I can tell this resolution because something I have to zoom and it disappears. I understand the difference between vector and raster so... this kind of problem is like when you zoom too in an image and it becomes pixelated... but otherwise...! I have a macbook pro 2012 model, the retina. is my screen resolution. I thought that the apple screen product meet good standards of adobe creative products... Reviews

    Check if the switch between the GPU and CPU makes a difference: Cmd E

    Or turn in the preferences: GPU performance.

  • I have iphone5s and my contact id does not work, all the time he show faild Setup touch id please help?

    I have iphone5s and my contact id does not work, all the time he show faild Setup touch id please help?

    Hi yjain51,

    I understand you had some problems recently with getting Touch ID to work reliably on your iPhone 5s. I know that it is a feature of great security for your iPhone, so I'm happy to help you.

    When you use Touch ID, make sure that your hands are free of any dirt or moisture so that fingerprints can be read clearly. This article explains further:

    Use the ID Touch on iPhone and iPad - Apple Support

    Thank you for using communities Support from Apple. See you soon!

  • What do need me for when the sale of an iPhone that won't turn on in order to remove my information?

    What do need me for when the sale of an iPhone that won't turn on in order to remove my information?

    If it lights why if someone buy it?

  • I want to make my laptop plugged in, but do not load when the battery reaches 95%. How can I do?

    H !!!

    I want some help to train you...

    There are growing problem in many portable of peoples that their laptop shows connected but does not support...

    But it's not my problem.

    My problem is just the opposite of it.

    I want to make my laptop plugged in but not in charge when the battery reaches 95% how can that I do?

    Hoping answers from you...........................................................................................................

    Original title: Performance and tools

    JNMilan,

    It is not possible. You must use a third-party software to do or contact the manufacturer.

    Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    Back to us for any problem related to Windows in the future.

  • I am trying to convert my trial creative Cloud to a version of payment, but I keep blocked when the computer asks me to enter a serial number, WHERE can I FIND? Thanks for your response

    I am trying to convert my trial creative Cloud to a version of payment, but I keep blocked when the computer asks me to enter a serial number, WHERE can I FIND? Thanks for your response

    Hello

    You can check out the link below.

    Applications creative Cloud back in test mode after an update until 2015 for CC

    Hope this will help you.

    Kind regards

    Hervé Khare

  • I have Acrobat Pro on my computer and I work with the drawing that have been digitized in PDF format. The scanners are not aligned or place because of the poor scanning process. Anyway is to align the document even if it requires me to crop or lose

    I have Acrobat Pro on my computer and I work with the drawing that have been digitized in PDF format. The scanners are not aligned or place because of the poor scanning process. Is there anyway to align the document even if it requires me to crop or lose some on the edges?

    Hi brad.

    Yes. You can use the analysis tools to straighten and crop your document. Here is a link to a new tutorial. The key to activate the sliding options recovery is to choose the option of the camera Image in the drop to Enhance, and gives you tools to set the correct page for smoothing areas.

    fundamental https://helpx.adobe.com/Acrobat/How-to/scan-Paper-documents-Searchable-PDF.html?Set=Acroba--principes t - create a pdf file

    Donna.

  • Internet does not seem to work after you have uninstalled Avira Premium Edition, but Google Chrome works

    Recently, I uninstalled Avira Premium Edition. I opted for 1 month trial but I uninstalled before the expiry of 1 month. The uninstall process went well. But when I restarted the computer, the Internet does not seem to work, but Google Chrome works as usual. When I tried to connect to MSN, it says "error Code: 80072ee7. It's something on the Internet connection. I guess it takes some files that must have accidentally disappeared with the uninstall process.

    Any help will be greatly appreciated. Thank you.

    Hello

    If Internet does not cam chrome Google work either.

    So, we know not what does not work.

    In any case, try this.


    WinSock and TCP/IP update.

    Type Cmd in the search text box.

    Press Ctrl-Shift-Enter keyboard shortcut to run a command as administrator prompt.  Allow the elevation.

    Type netsh winsock reset at the command prompt and press the Enter key.

    Do the same process to refresh the TCP/IP just replace the command typed with.

    netsh interface ipv4 reset Press enter

    netsh interface ipv6 reset Press enter

    ipconfig/flushdns press Enter

    Restart your computer.

    Jack - Microsoft MVP, Windows networking. WWW.EZLAN.NET

  • G560 boots with no HD but does not work when pluged-in HD

    Well, this laptop is a piece of sh...

    I deleted the partition table, restart, then the computer freezes. Press F2 and it says 'enter the Setup... ". "but nothing happens. When press F12 the same thing...

    I read that if you remove the HD the computer continues to start, and it did! (clearly a bug) And you can even get into the BIOS or select bootable media. But of course I need a HD. I think the problem is delete the hidden partition (maybe wrong) and when the HD does not find it, it freezes. It's a bug, but it does not use the HD.

    So what I try to do tent to retrieve the table to partition with testdisk (Linux) plug the HD on my desktop computer.

    What would be nice if someone has this hidden partition, you could make a picture of it and upload it somewhere. Because there could be a chance that I won't be able to get it back. And I also need information on the partition so I can do it, in case I need to do...

    Any help is appreciated.

    Thank you!

    I corrected! I have delete all partitions and patition table. I created a new partition with an ext4 partition table and it worked.

    So problem solved.

    I'm sorry to bother you.

  • E7440 latitude: Wake-on-Lan works when the laptop is turned off, but not when it's put into hibernation

    I have a Latitude E7440 running a clean install of Windows 10. If the computer has been stopped, I can use a Wake - On - Lan Magic Packet to the MAC address of the Ethernet port (as described here) to turn the computer back on. But if the computer is in hibernation, it does not work.

    Probably, it is that when the computer is in hibernation the link on my switch light is off, but when it is stopped, the link light is on.

    So my question is: How can I get this phone to maintain the LAN port when hibernation, in the same way on shutdown? Thanks in advance.

    smammy,

    Click on the link below for a possible resolution following on problem of your computer network settings.

    How do I enable Wake on Lan on Windows 10

Maybe you are looking for

  • Lenovo Thinkpad T430

    Hi guys,. I'm new to the forum and have only recently bought my Lenovo Thinkpad T430. I'm looking to add an internal SSD flash drive and move the HARD drive in the ultrabay port sitting factory. I just want to confirm with you kind people that I boug

  • G56 Windows 7. : get the power back. the password

    Locked put the entire computer. Password administration & power on password is incorrect. Disabled system. 66517742

  • Cannot get native resolution on hp pavillion dv9310us after the upgrade to Windows 8

    I just upgraded my computer hp laptop Pavilion dv9310us from Windows Vista to Windows 8. Worked well, except that Windows 8 has a 1024 x 768 screen resolution of the laptop.  There is no option to set it to any other screen resolutions. And the only

  • Firesight 750 data sheet

    Where can I get the sheet (energy consumption) for device Cisco Firesight 750, I don't have it on the site of the CISO.

  • Windows 8.1 upgrade Pro

    Hello, I wonder if you can help me please; I have a customer who bought a Windows computer with installed Pro 8.1. It appeared since then, as the company that she bought it it load with Windows 8.1 (not the 8.1 Pro), he has now not activated itself a