A script to increase the minimum canvas size? (Like Image to adjust, but with just my canvas)

First to be clear, I'm looking to manipulate the size of the canvas. No image size.

I want to create a script to automatically increase the width and the height of my canvas in Photoshop to a size specific, when necessary. I don't want that to happen if my canvas is smaller than the specified size. For example: Let's say my canvas size is 300 x 250. I want the Web to be at LEAST 600 x 600. If I run my action, it will increase the size of the canvas to 600 x 600 for me. If I run this same script on an image where the size of the canvas is already 700 x 700, it did nothing for her because the width and height are equal to or greater than the size of my target.

She will also work with the height and width on an individual basis. If my image is 400 x 800, the action would increase my width of 400 to 600, but he let the height of 800 only. If the final canvas size will eventually be 600 x 800.

It's a bit like the option 'Adapter the Image' in Photoshop, but I want only to manipulate the size of my canvas, NOT the size of my image.

You can try this:

// resize canvas in either direction if it is below a defined minimum;
// 2011; use it at your own risk;
#target photoshop
if (app.documents.length > 0) {
var myDocument = app.activeDocument;
// set to pixels;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
// set the minimum values;
var minWidth = 600;
var minHeight = 600;
// get current ones;
var theWidth = myDocument.width;
var theHeight = myDocument.height;
// resize canvas;
myDocument.resizeCanvas(Math.max(minWidth, theWidth), Math.max(minHeight, theHeight), AnchorPosition.MIDDLECENTER);
// reset;
app.preferences.rulerUnits = originalRulerUnits;
};

Tags: Photoshop

Similar Questions

  • I get a message saying "you have exceeded your profile storage space. Yet all the files listed th are actually my docs and application data. How to delete my profile, but not from my pc? increase the max profile size

    I get a message saying "you have exceeded your profile storage space. Yet all the files listed th are actually my docs and application data. How to delete my profile, but not from my pc? increase the max profile size

    1. the first thing to do is to make sure that the computer is completely virus/malware-free. Googling around this error produced quite a few links where the posters were or had been infected with Spyware Protect 2009 rogue.

    http://www.elephantboycomputers.com/page2.html#Removing_Malware

    Once the scanning is complete (do not skip the preparatory stages no more), if the problem persists:

    2. double-click on my computer, right-click the icon for your hard drive, click left to get its properties. If you see options to set Quota management make sure that they are disabled.

    3. in the case - BUT ONLY AFTER YOU ARE sure THAT THE MACHINE IS MALWARE/VIRUS-FREE - copy the lines between asterisks (not including the asterisks) below and paste it into Notepad. Save as undopolicy.reg somewhere, you will find. And then double-click the .reg file, that you have just made to melt in your registry. I hope that this will take care of the issue.

    *****
    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]
    'EnableProfileQuota ' = -.
    'ProfileQuotaMessage ' = -.
    "MaxProfileSize" = -.
    'IncludeRegInProQuota ' = -.
    'WarnUser ' = -.
    'WarnUserTimeout ' = -.
    *****

    MS - MVP - Elephant Boy computers - don't panic!

  • BlackBerry Smartphones how can I increase the maximum file size allowed on the media?

    Whenever I have record video using the video camera, after a very short time it will stop recording and gives a message 'maximum size of the file reaches. I've adjusted the settings to save in 'Normal' mode, but while recording appears in last a short time, the result file size is way too big to be able to easily send to contacts. When you use the MMS mode the recording time is much too short. Is it possible to increase the maximum allowed size of the file so that a resulting video would be about 3-4 MB or less?

    You can download any software video conversion on the net. just try this one "Freestudio".

  • How can I increase the resolution (DPI / PPP) an image scanned on my iMac?

    How can I increase the resolution of a scanned image. I am currently using a new all-in-one Photosmart HP 5512, I installed everything to the natural drivers have a usp cable connecting the PRINTER to my iMac. I'm on OS 10.7.4.

    The HP icon utility allows me only increase the size of the file (image quality) not the PPP/CIO

    Thanks in advance for any help

    Hello

    You can change the resolution using the application from HP as follows:

    Click HP scan at the top and then click on Preferences.

    In the launch windows, select the required resolution.

    Close the preferences window and perform analysis.

    Kind regards

    Shlomi

  • Do you know what does DPI mean? How can I increase the resolution of a TIFF image at 300 DPI for shipment to a Publisher?

    Is anyone here know what DPI?  How can I increase the resolution of a TIFF image at 300 DPI for shipment to a Publisher?

    If the resolution is already less than 300, may not increase to make it higher. You can only do low.

    =====================================
    Yes, you can increase the DPI value.

  • I'm unable to download apps from creative cloud to my MacBook Pro.  I downloaded the package install twice.  I can double click on the installer and it seems to be downloading, but it just guard spinning for 10-15 minutes, then gives me an error and a pro

    ??? I'm unable to download apps from creative cloud to my MacBook Pro.  I downloaded the package install twice.  I can double click on the installer and it seems to be loading but it just guard spinning for 10-15 minutes, then gives me an error and a blue button to get help.  We have other MacBook Pro in the studio and just downloaded quickly.  Any ideas?

    Hello

    Run Adobe Cleaner tool - https://helpx.adobe.com/creative-cloud/kb/cc-cleaner-tool-installation-problems.html

    Download creative cloud of Download Adobe Creative Cloud apps | Adobe Creative Cloud free trial

    If this does not help then follow the steps mentioned below.

    1. Access \User\\Library\Application Support\Adobe *

    And/Library/Application Support / Adobe *.

    To access the hidden user library folder, see library user access hidden files. Mac OS 10.7 and later.

    1. Find and delete the files AAMUpdater and OOBE
    2. / Library/Application Support/Adobe (rename Adobe Application Manager and Adobe of joint office)
    3. Go > utilities > (rename Adobe Application Manager and creative cloud)
    4. Download Creative cloud-apps Download Adobe Creative Cloud | Adobe Creative Cloud free trial

    Let us know if this will help.

  • Where is the minimum font size in Safari Version 10.0 (11602.1.50.0.10)?

    I need to control the font size in Safari. Apple seems to have removed. Does anyone know where the police since the previous version of Safari controls went?

    Workarounds don't work. I find myself with a page too big for my Air 13 "screen if fonts are quite large. If the Safari page fits the screen, fonts are too low.

    (insert a LOT of expletives here).

    Help!

    Just found out his omission, too!  Horrible!

    Minimum font size control has been using Safari... keys to allow the text on the pages to have a readable size.  What is happening with Apple?

    Now, perhaps, there is an extension that can do this.  OFF to get one!

  • The minimum window size

    Hello world

    I can't find a way to prevent the user from resizing the window extension below a certain size. I tried to fix the extension like this min_width and min_height:

    var instance: CSXSInterface = CSXSInterface.getInstance ();

    var extension: Extension = instance.getExtensions ([instance.getExtensionId ()]) .data [0] as an Extension;

    extension.minHeight = 350;

    extension.minWidth = 250;

    But it does not work, I can always manually resize the extension Panel in InDesign.

    Anyone knnow how to set the minimum size of the extension window/Panel?

    Thanks in advance for your help.

    -Bastien

    Define what is in the manifest.

    Substances

  • How can I increase the resolution of a scanned image. It's about 200 dpi and I want about 600.

    I have a Hp Officejet J4680 all-in-one printer/scanner. When I scan in an image and save it as a jpeg, the resulting image is about 200 dpi. I need a higher resolution. The data sheet says 1200 dpi is available, but I do not see how to choose the size of resolution. Thank you!

    Let's try this

    Open HP Solution Center.

    Click "scan picture". A new window will open.

    In the left part of the window, under shortcuts scan select "scan picture".

    On the right, select image under the type of analysis.

    Below this "Advanced picture settings' tab is present. Click on it. A new window will open.

    The resolution is given here. Click on drop down menu, then select your desired resolution. After you only click 'OK '. Click on scan.

    I hope it works!

    Lucky_question wrote:

    I have a Hp Officejet J4680 all-in-one printer/scanner. When I scan in an image and save it as a jpeg, the resulting image is about 200 dpi. I need a higher resolution. The data sheet says 1200 dpi is available, but I do not see how to choose the size of resolution. Thank you!

  • Firefox on the laptop of my wife lost the black bar that displays maps, Gmail etc. Now at the top of the screen there is an empty bar, triple height, with just the Google search box entry. How can I get that back? Or is it a question for Google?

    When I open Firefox there is a black bar, sometimes vertical, sometimes horizontal, in the upper part, with links to maps, Gmail etc. When I opened Gmail the same links are listed at the top of the screen, just under the tabs. In my wife's cell phone, it appears in the Firefox splash screen, but not in the form of Gmail. In the top of the screen is an extra-large gray bar with just one Google search box entry. Is this a problem of Firefox or Google?

    She has XP Home SP3 and Firefox 9

    Thanks for any help.

    Is there still the Google URL in the address bar?

    Reload Web pages, and ignore the cache.

    • Hold SHIFT and click reload.
    • Press 'Ctrl + F5' or 'Ctrl + Shift + R' (Windows, Linux)
    • Press 'Cmd + Shift + R' (MAC)
  • Increase the length of size and recorder circular buffer

    Hello again!

    First of all:

    I have a problem with the circular buffer.

    I was able with a sampling frequency of 1000 Hz I used 6 circular buffers, each with a size of buffer for 30 minutes. It was no problem for the PC. I do not have such a high sampling rate, but I need a buffer size that is larger, something between 90 and 120 minutes with 8 pads. so I decided to reduce the sampling rate of what I need, it's 50 Hz. Because I reduced the sampling rate to 1/20 of the original sampling frequency I thought that a buffer size of 120 minutes should be possible.

    Now, after trying the new sampling rate, I still can't use the 8 pads with more than 60 minutes. Any ideas why I had this problem? How can I provide a larger buffer, no possibility?

    Second:

    I use the recorder for display. I would like to display voltage in the long term. With the recorder the maximum length is approximately 3.5 hours. How can I view on longer periods? What I need to display the length in days. Is this possible? Perhaps with the other modules or almost?

    That's it for now, thank you a lot for the useful tips.

    Good day!

    Good bye

    The maximum time width of the graphic recorder or Y/t diagram is a function of memory (RAM) on the computer, the number of channels to display and the sampling frequency. Dynamically, the memory is allocated to the maximum. To avoid using RAM available on the computer, DASYLab is limited to half of the memory of the computer.

    That being said... How you appear more time? You can reduce the number of samples using average or separate modules - in effect, reducing the sampling frequency. Alternatively, you can consider if the trigger on demand and a relay may be able to effectively reduce the samples for data to slow evolution.

    Some clients have two screens high resolution on a shorter and more low resolution over a longer period.

  • By default on the minimum window size

    How can I change the default size on a window?  When I open IE, it opens in a small window that I maximize to see anything. How can I change it to open up to a size full screen?

    http://www.theeldergeek.com/maximize_internet_explorer.htm

    Read above on how to open IE "maximinised."

    See you soon.

    Mick Murphy - Microsoft partner

  • Calculation of the minimum required size for a BasicEditField

    Hello

    I hope someone can help! This is continued in another post, I had about resize a BasicEditField so I could put a button on the same line.

    I re-size my BasicEditField to be half the width of the screen. I also set the maximum number of characters which they reached 6. When the user tries to enter the character 7 I get an alert that the field is full. I have a border around the BasicEditField and the user, it seems they should be able to enter more characters that is to say the space to enter the number is much larger than 6 characters.

    Does anyone know a way to calculate the size so the domain will be the right size it of to say to fit to the label and up to 6 characters, but not bigger?

    I hope I've explained this well enough to understand. Thanks in advance for any help

    Just put a code here:

    http://supportforums.BlackBerry.com/T5/Java-development/please-help-with-trying-to-put-a-BasicEditFi...

  • How to increase the default window size?

    Original title: default window size

    My windows 7 opens too small windows.  Can not know how to make default to a larger size.

    Hi archievee.

    Do not use Maximize. Take the corners of the window and drag it to the format full screen. Close all other windows first via the taskbar and the latter. Windows will remember the size of the last closed window.

    If this does not work, try this.

    Right-click on the icon and select Properties. Under the run drop-down list, select Maximized.

    I hope this helps.

  • Increase the huge file size.

    So I've recently updated for first Pro CC 2015.3. I was doing a video which is 40 seconds long. The only thing in the video is the text and music. I exported using the same setting that I used in first Pro CC 2015. With first Pro CC 2015 the size of the file is usually around 200 MB. With first Pro CC 2015.3, the file size was 4.7 GB. I was wondering if there is anyway to make it back to what it was before. Thank you!

    File size is determined by length, bitrate, and only two things.

    If you want a smaller file, you'll need a shorter program, or a lower rate.

Maybe you are looking for

  • HP Pavilion a6000n: no need for replacement motherboard - it's the standard micro ATX?

    I want to upgrade this computer and get a new card mother and CPU. Currently there is a M2N68-LA/NARRATED-GL8E made by Asus for HP. No matter what micro ATX motherboard will work, or that it has an odd size or placement of screw hole or else incompat

  • Elitepad 900 window 8 reload

    HelloI have an Elitepad that was given to me by HP, 900 which I work for personal purposes. He came with the Enterprise build of Windows 8. How can I get that back to the version of Windows, it came with? The recovery partition has been deleted.Any i

  • No Bluetooth mouse at startup

    I have an IMac which, for some unknown reason, insist on the use of a mouse bluetooth at startup. I don't have a bluetooth mouse! The consequence of this is that I can not connect to the machine more. How can I start the machine so that I can fix the

  • Problem of access to assets

    Hey guys I have this code void Storage::initialize() { isCacheValid = false; if(!QFile::exists("db/MoneyTracker.db")) { database = new SqlDataAccess("db/MoneyTracker.db"); QFile initScript(QDir::currentPath() + "app/native/assets/dbCreatorScript.sql"

  • Canon ixus 80is error USB driver generico

    Connect usb camara canon ixus 80is por Al da error el generico pilot of w7sp1