Crop canvas based on the suffix of the filename (big, _medium, details)

I have this recurring task of cropping of images, on a daily basis, each in 3 different versions, a 630 x 515 * grand, a 274 x 134 * _medium and a 173 x 106 * details.

I am currently working with 3 different actions (select canvas > copy > resize > paste in place) one for each size, since I have to manually free transform it and choose a suitable such as visible place (report l / h of the source images varies a lot).

Yet, I need to check the name of the file and then use the correct action, which given the amount of time I do it, it is not only slow, but also prone to errors.

I have a button that I can use that is only mentioned action (even if she calls just adequate action) based on the file name suffix.

I made a blunder in the code.  These two lines to replace lines 4 & 5:

var docName = docRef.name.split('.') [0] .split ('_');

var docSize = docName [docName.length - 1]

Tags: Photoshop

Similar Questions

  • Batch increase canvas based on the proportions of each image

    Hello

    I'm new to scripting, so expect stupid questions

    I need to take pictures of 1900, make them square by increasing the canvas of each image and then convert them to 600x600px

    The thing that is stumping me is that each image source has a ratio of different size\aspect

    Is this possible?

    TIA

    I guess you could same Action with file > Automate > Fit Image and then use the canvas size.

    But for what is a script, you can simply use a conditional clause:

    #target photoshop
    var myDocument = app.activeDocument;
    var width = myDocument.width;
    var height = myDocument.height;
    if (width > height) {
         myDocument.resizeCanvas (width, width)
         }
    else {
         myDocument.resizeCanvas (height, height)
         };
    myDocument.resizeImage (new UnitValue(600, "px"), new UnitValue(600, "px"), undefined, ResampleMethod.BICUBIC);
    
  • Satellite A210-1BX - error based on the CD/DVD drive

    Hello

    I have a problem with my DVD writer! I use Nero and if I burn MP3 CD or DVD .avi files happens whenever an error based on the drive. No detail!
    But on the CD are the opder of 1/2 3/4 data!
    If I insert an .mp3 CD Windows Vista said, the CD is empty! Vista is already NEW!

    Can someone help me? Or I have to contact Toshiba, I guarantee!

    Thank you

    Hello!

    Have you checked the site factory of Nero for an update? Maybe it s just a software problem that the burning procedure fails.
    In addition, you can try another burning program. A few days ago, I tested CD BurnerXP and I was very surprised! It s a freeware program and it also contains a large number of functions that it s worth a try! ;)

    Here in the forum I noticed that the dismantling of the upper and lower filters can often solve problems with the CD/DVD drive to check of workaround from Microsoft:
    http://support.Microsoft.com/kb/314060

    Good bye

  • How to print crop marks, but keep the cut as A4 paper

    I was asked to create a brochure, although I normally do web development. So I installed InDesign a week, with no prior experience. I did created the brochure, created a PDF high resolution (using export) and sent to printing, assuming that it would be sufficient. It didn't: they must "impression of brands" (says my client), I'll assume that is crop marks.

    So I thought that everything I could on works bleeding and slightly modified my design to accommodate that (I got a few horizons towards the edges). But the question I have now is that I don't know how to create a PDF file with the right dimensions: A4 for the resulting page and crop around her landmarks.

    My Document configuration is set to A4 size (not counting the bleed). It is in the mm, so 210 x 297 mm. The purge is set to 3 mm on all sides. Slug is set to 0.

    So I'm going to file > print (in PDF), under Configuration to scale to 100% and marks and purge check "of crop marks. But the problem is that my design already covers the entire area of the A4, so the crop markers to add 'outside' of it. It does not, because "Paper size" corresponds to A4, as well as crop marks are not printed, they fall outside the print area (if my design is focused; it is top-left, I lose the right and down). Now, I can force it to print crop marks using "Scale to fit" - but then of course my page which is no longer not A4; evolving just everything down so that the crop are in the edges of a regular A4 format. But at least I see pretty brands he creates then.

    I know that I need to print on A4 oversize, but I can't figure out how to get that. I could fix it manually by adding a number of mm to the width and height, but I read everywhere that InDesign is supposed to do it automatically. So I think there is an option somewhere that I can't find.

    So my question is: where is the option to automatically increase my 'paper size' when printing to PDF, based on my configuration Document as well as the area for bleeds and crop marks?

    (this seems a simple question that I am surprised, that I can't seem to Google an answer to this...)

    Joris debonnet wrote:

    So I'm going to file > print (in PDF)

    This is your mistake. Use file > export... and choose Adobe PDF (Print) from the drop-down list type or file > Adobe PDF presets and choose the correct preset in the list based on that to your printer. Under the control of marks and bleeds box to use the settings of purge of paper and boxes for the brands you want - for sure, guides of crop possibly as well information page, and bars of color or brand registration request printer.

  • display a viewstack based on the selected item in a datagrid control

    Hello

    I am bit new to bending even though I have been using CF for a while but could do with what I hope, it's a simple answer to a simple question...

    I have a datagrid that displays a number of columns that a 'typical' I want to be able to display a viewstack child is based on the "type" selected in the data grid. I tried a number of ways that fail, annoyingly.

    the latest incarnation of the code is as follows

    part of script function

    private void dataGridChangeHandler(event:Event):void
    {
    Get the line datagrid selected item
    var Type: String = event.target.selectedIndex;

    Set the index of view stack
    this.pagesStack.id = Type;
    }

    <! - part datagrid - >

    < mx:DataGrid id = "EpisodeDatagrid" selectable = "true" = "true" Exchange draggableColumns = "this.dataGridChangeHandler" variableRowHeight = "true" editable = "false" height = "100%" textAlign = "center" width = "100%" > "
    < mx:columns >
    < mx:DataGridColumn id = "startdate" dataField = "EpisodeStartdate" headerText = "Start Date" labelFunction = "dateLabelFunction" headerWordWrap = "true" / >
    < mx:DataGridColumn id = "enddate" dataField = "EpisodeEnddate" headerText = "End Date" labelFunction = "dateLabelFunction" headerWordWrap = "true" / >
    < mx:DataGridColumn id = dataField 'Type' = "Episodetype" headerText = "Type" headerWordWrap = "true" / >
    < mx:DataGridColumn id = "Status" dataField = "EpisodeStatus" headerText = "Status" headerWordWrap = "true" itemRenderer = "active" / >

    < / mx:columns >

    < / mx:DataGrid >

    <!-Viewstack part->

    < mx:HBox width = '100 percent"height ="100% ">

    < mx:ViewStack id = "pagesStack" width = "555" height = "202" >

    < mx:Canvas id = "DIP" label = "DIP" >
    < mx:Panel x = "10" y = "10" width = "250" height = "200" layout = "absolute" >

    < mx:Label = "19" x = "51" text = "DIP" / >
    < / mx:Panel >
    < / mx:Canvas >

    < mx:Canvas id = "ERASER" label = "ERASER" width = "100 percent" height = "100%" >
    < mx:Label = "19" x = "51" text = "ERASER" / >
    < / mx:Canvas >

    < / mx:ViewStack >

    < / mx:HBox >

    help would be very appreciated (code example would be more appreciated :)

    
    
         
              
         
         
         
              
                   
              
              
                   
              
              
                   
              
         
    
    
    
  • How ItemRenderer change for DataGrid column based on the value of this column?

    Hello! I am trying to create a DataGrid that has a component Button to register when the value of this column is 'Open', then a label saying full when the value of this column is "Full". But Im having a hell of a time he find.

    Here's my MXML with 2 different inline installation of components for different rendering engines point 2:

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "absolute" >

    < mx:Component id = "RegFull" >
    < mx:VBox horizontalAlign = "center" verticalAlign = "middle" >
    < mx:Label id = 'Full text' text = "Full" / >
    < / mx:VBox >
    < / mx:Component >

    < mx:Component id = "RegButton" >
    < mx:VBox horizontalAlign = "center" verticalAlign = "middle" >
    < mx:Button label = "Save" / >
    < / mx:VBox >
    < / mx:Component >

    < mx:DataGrid id = "scGrid" width = "100%" height = "100%" number of lines = "4" >

    < mx:dataProvider >
    < mx:Object label = "Status" data = 'Open' / >
    < mx:Object label = "Status" data = "Full" / >
    < mx:Object label = "Status" data = 'Open' / >
    < mx:Object label = "Status" data = "Full" / >
    < mx:Object label = "Status" data = 'Open' / >
    < mx:Object label = "Status" data = "Full" / >
    < / mx:dataProvider >

    < mx:columns >
    < mx:DataGridColumn id = "RegCol" headerText = "Reg" dataField = "data" / >
    < / mx:columns >

    < / mx:DataGrid >
    < / mx:Application >

    How can I dynamically use the right of itemrenderer based on the value of the field? THANKS FOR ANY HELP PROVIDED!

    The best
    Stephen

    You can have more than 1 column renderer engine. There are two ways to do this. One way would be to use States. A State for each possible value in the data. Since you either want a button (data == 'open') or a label (data == 'Full') by using the States wouldn't be a bad choice.

    Alternatively, you can use a canvas instead of a VBox. Make a label and a button with horizontalCenter = "0" "0" = red to make them each other. Make it visible according to the data value:






    where dataField is the value of the property dataField on this converter DataGridColumn.

  • 'Burned' fingers index to use MacBook Pro trackpad: my both hands, index fingers. which are based on the computer next to the trackpad or are used on the trackboard are painful, feel like they were burnt, and I can barely move them.  Yes, I did

    My both hands, index fingers. which are based on the computer next to the trackpad or are used on the trackboard are painful, feel like they were burnt, and I can barely move them.  I do not have this problem before, I bought my new Mac - specifications below: it hurts and I don't have a problem with my windows, iPad or Samsung Galaxy equipment operating systems computers.

    It feels like radiation leaking through the computer case.  Is the radiation involved in the chips?

    MacBook Pro

    Model identifier: MacBookPro11, 4

    Processor name: Intel Core i7

    Processor speed: 2.2 GHz

    Number of processors: 1

    Total number of Cores: 4

    (By heart) L2 Cache: 256 KB

    L3 Cache: 6 MB

    Memory: 16 GB

    Boot ROM version: MBP114.0172.B06

    Version of the SCM (System): 2.29f24

    Are you use while plugged in, I feel a buzzing in my 13-inch rMBP (12.1)

  • How can I change the default Google search engine in Firefox 8 Google.com to google.co.uk? Yes, I live in France with a French ISP, but English is my mother tongue and I want responses based in the United Kingdom.

    How can I change the default Google search engine in Firefox 8 Google.com to google.co.uk? Yes, I live in France with a French ISP, but English is my mother tongue and I want responses based in the United Kingdom.

    I use XP Pro.

    You can find on the site of Mycroft Project search engines.

  • Can I make smart albums based on the location?

    Can I make smart albums based on the location of the GPS?

    For example, in the street, city, etc.?

    Thank you

    [City] - includes the menuFichier ==> new smart album - text or text [Street] etc.

    LN

  • VI to convert input signals NI 9402 in a RPM value, based on the frequency of the pulses

    Hello

    I'm looking for a VI convert an input signal NI 9402 in a RPM value, based on the frequency of the pulses. Is there such a thing that exists in the library of national instruments?

    I run LAbview 2014 integrated control and monitoring on on a cRIO 9802 high performance integrated system with NEITHER 9402, 4 channels, 50 LV, LV TTL Module input/output digital, ultra high speed digital i/o for the cRIO module.

    Any help would be greatly appreciated.

    The easiest way is to use the FPGA to get the time between the edges of your pulse increase (shift registers to maintain the current situation and the time will be necessary).  This will give you the period.  If it's a single pulse per turn, then the number of laps is just 60/T, where T is the time in seconds.

  • You are looking for the block CD build based on the time for MPC simulation.vi

    Hello everyone! I'm trying to implement MPC in LabVIEW. I downloaded some code that shows the implementation. My question is in these codes that I see a named block as CD build based on the time for MPC simulation.vi. I tried to find a lot of this block, but I could not... Can someone help me with the problem (exactly under what section I get this block) or can someone tell me how can I give the profile of setpoint for the problem of simulation MPC?

    The associated screws to generate the profile found in:

    C:\Program Files (x 86) \National Instruments\LabVIEW 2011\vi.lib\addons\Control Design\_MPC\Reference profile

    or

    C:\Program NIUninstaller Instruments\LabVIEW 2011\\vi.lib\addons\Control Design\_MPC\Reference profile

    You can look at examples of:

    C:\Program Files (x 86) \National Instruments\LabVIEW 2011\examples\Control and Simulation\Control Design\MPC

    C:\Program NIUninstaller Instruments\LabVIEW 2011\examples\Control and Simulation\Control Design\MPC

    to check the use of these screws

  • How do I script in DIAdem to include specific lines of code (similar to .ini in LabVIEW files) based on the computer/user?

    I took Basic training courses so DIAdem Advanced and have been scripting for several months.  I am interested in how to include specific lines of code based on the computer.  Told me it would be similar to .ini in LabVIEW files, although I've never used myself .ini files.

    Hi Karen,.

    What do you mean by "includes the lines of code?  Do you mean what happens when you run a command 'ScriptInclude()' or 'ScriptCmdAdd()' in a tiara VBScript?  Or do you mean that you want to run several lines as DIAdem begins, similar to 'ScriptStart() '?

    What do you mean by "computer-based?  Do you mean you want to implement different batch files on different computers, but you are still using the same file (named) command on each target computer?  Or do you mean that you want to implement the same command on all target computers file, but you want different commands to run this file based on the computer on which you are.  In the latter case, how do you determine computer on which you are on - MAC address, logged in user name, or what?

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • Internal analysis based on the error Code 7

    I am trying to create the Setup program for one of my application and got stuck with deployment error. Build state indicates as follows

    From a newspaper for the deployment.

    Based on the analysis

    Analysis completed

    Error code internal 7 analysis of departure

    Path must be a directory or a LLB.

    Abandoned

    When you click the Distributor tab, he asks "Do you want to analyze the source files?", when I click OK, it says-" < no="" file="" information,="" analyze="" a="" workspace=""> "

    But it does not give the same problem when I uncheck the "of Teststand public directories' in the Source System tab. But I need to include the public directory to create the installer properly. What could be the problem?

    I created Installer a few months back and its job perfectly well. But now I need to review the sequence, that is why the installation program. But not stuck

    TestStand Version 2012

    Fransico,

    I have re installed Teststand 2012 and the issue has been resolved. could not figure that out what was going on. Then uninstalled Teststand 2012.

  • How to case statement based on the array of values of 3 or more?

    I'm trying to figure out how to do a comparison or case structure... based on the creation of an array of boolean 3 (or maybe more).

    I have a table (it's from a serial connection, and I am conversion back to a table to work with) [t, F, F] in this case I would like to display on a status indicator "STBY".

    If the array is defined on [F, T, F] I want to display in this indicator "ON".

    If the array is defined on [F, F, T] I want to display in this "EMPTY" indicator

    I can not understand how to compare combinations of things... I read in an array of bytes, and the first 3 bits in this example, determine what to display in a status... I can't figure out how to do with structure case... or without some channels to research and/or bad comparison...

    Any suggestions?

    Thanks in advance,

    Cayenne

    You can use search 1 d array and find the first real.

    Or you could convert the table of Boolean integer U8 and integer that results to determine which cases to run.  (4, vs, vs 1-2)

  • Change the text displayed, based on the threshold value

    Hi users of Labview,.

    I need help with display and editing text in labview.

    The text should display and change according to the following conditions:

    0 volt - "no power".

    1 volt - "controller ON".

    2 Volt - "Rotor Running"

    3 volt - "Rotor stopped".

    Based on the voltage read by the channel, the text must be displayed and modified on the same area of the front panel. For example, initially it will be 0 Volt and the text "No power" should appear as an indicator of text (and not as a warning message). He needs to change ' controller we ' when the chages of voltage from 0 to 1 volt. The canal reads the analog input voltage (range 0 - 5V).

    I'm relatively new to labview. So please give me pointers or from suggestions on how can be done. Any help is greatly appreciated.

    Thank you

    REDA

    Hello

    Thanks for the crossrulz of notes, have not used the front threshold.  For this simple example, it is "symmetrical", but I can see how the values in the table have been does not correspond to the index position that is so true useful.  Learn something every day, I could not resist, wanted to try.

    OK, here's a sample VI that puts a custom message based on the crossing of a threshold.  Home work is to study the components before asking to :-)

    The dice are the analog signal of 0 to 6.   He rounded to the whole number to provide the index number.  Power is the index number in the index table, the table being hard-coded text messages.

    Two additional indicators may be deleted, useful to see what is happening.

    And get rid of the value 0 if you want the text to match the number, he he he

    Enjoy.

Maybe you are looking for