Run action on specific file size

I feel like such a noob when it comes to scripting.
I'm trying to create a script that will place my logo on my images.  My logo size varies depending if it's a wallet, 4x5, 5x7, 8x10.
I know how to check if the activeDocument.width is greater than it's height and run the appropriate logo placement action, but am unsure how to get everything to run automatically depending on the pixel size (if activeDocument.width is 2100 pixels, run 5x7 horizontal logo action).  Not sure if I can use multiple conditions like:
if (activeDocument.width > activeDocument.height) AND activeDocument.width = 2100 pixels
    doAction("5x7_H","5x7_.atn");
The coding isn't correct, but describes what I'm trying to do.
Thanks

Paul,
Doesn't your code run the same action for both horz and vert docs. And assume they are 300 ppi?
How about something like this
#target photoshop
var doc = app.activeDocument;
var Width = doc.width.as('in');
var Height = doc.height.as('in');
var Max = Math.max(Width,Height);
switch (Max){
case 6 : //6 inch longside
                    if(activeDocument.width > activeDocument.height){
                         doAction ("4x6_H", "actionSet");
                    }else{
                         doAction ("4x6_V", "actionSet");
                    break;
case 7 :// 7 inch longside
                    if(activeDocument.width > activeDocument.height){
                         doAction ("5x7_H", "actionSet");
                    }else{
                         doAction ("5x7_V", "actionSet");
                    break;
case 10 : // 10 inch longside
                    if(activeDocument.width > activeDocument.height){
                         doAction ("8x10_H", "actionSet");
                    }else{
                         doAction ("8x10_V", "actionSet");
                    break;
default : break;

Similar Messages

  • Searching for a specific file size

    Hello,
    It's been a while but it seems like XP let me search for specific file sizes - e.g. if I wanted to search for files that were greater than 10GB or if I wanted to search for files less than 20GB.
    I can't figure it out in Windows 8.1.
    If the answer is possible through standard search and not powershell, I'd prefer the GUI way.
    Thanks

    In File Explorer (was Windows Explorer), type the search criteria into the box in the top right of the screen and press Enter.
    Example searches are:
    A minimum file size, simply type size:>30,000KB into the Search box and press Enter.
    type:=.pdf or type:=.doc will display specific file types.
    filename:x will display files using a partial filename. x represents the partial filename you want to search for.
    kind:video, kind:music or kind:pictures will find all the videos, music or pictures.
    If you just click or tap in the Search box, Search Tools will appear which allows the choosing of a Kind, a Size, Date Modified, Other Properties and Advanced search. In Folder Options > Search Tab, the search options can be changed, e.g. Find partial
    matches.
    Providing the location is indexed, you can search in File Explorer for a specific word or phrase by typing content:
    followed by your phrase enclosed in double quotes. This will produce a list of files matching the criterion.
    Speed up the search by opening File Explorer (was Windows Explorer) at the folder you want to search, rather than at the root folder. Also, pressing F3 will show Search options like Date Modified and Size.
    Ninety-nine per cent of politicians give the rest a bad name.

  • Hitting a specific file size when exporting from Flash CS5

    I need to export three banners to .swf from flash and they all need to be under 61K.  They all use photographs and are 5-7 seconds long each and the dimentions are 300x250 px, 300x600 px & 728x90 px.  Is there any way I can put in the specific file size in the program and make it under 61k?  I tried using the publish settings and lowering the quality and even at 40% quality the file size only went down 20KB from 147 to 127.  If you cannot do that in the program is there any third party programs that can be used to do this?  Thanks for your help!

    What you should do is set the Publish Settings to generate a size report.  That way you will have a detailed listing of what each element of the design contributes to the file weight.  I would guess that the images are going to be the heavy hitters, so you might need to use image software to optimize them as much as possible before importing them into Flash.

  • Specific file sizes

    Hi all!
    I was wondering if anyone could help me with creating a specific file size.
    As far as I'm aware, file size is strictly dependent on content.
    However, I have a request to make a 2MB file - no more, no less.
    As is stands, I have a 1.3MB file (This is at it's smallest setting in the 'save as' dialogue box)
    I am working in Acrobat Pro 9.1.2
    Many thanks for any help!
    B

    Thank you for your reply
    I was hoping it wouldn't involve trial and error tweaking -it's time consuming and it's a luxury I don't have.
    But thats the only way I can think of doing it too!
    I find other files on the web that have specific sizes - there must be an easier way...
    BellaDesigner

  • Problem exporting image to specific file size

    I've had some professional images shot and I can see from the file size in Aperture that they range from 13 - 73 mb. I need to submit them as 72dpi and 300dpi files and they must be between 1 & 3 mb in size.
    I'm having no problems in exporting them at the correct dpi but the file sizes come out between 451kb and 1.8kb: 3 of the 6 images are too small, ie under 1mb.
    What I'm doing is 'export version', then choosing the preset option of 'jpeg original size', editing it to the dpi I want, setting the image quality at a max of 12.
    How can I get these file sizes to be bigger?
    Thanks, and please help me quickly because I've a submission deadline approaching!

    Well that's interesting Ernie. I did as you said, but also exported an image while I had the settings at 4288 x 4288 pixels. The resultant file size at that setting is 1.4MB. The file size when I went back to 'original size' is 795KB, exactly the same as before.
    So I thought - if I can go above original size in that way, then can I alter the % to be over 100? I tried at 150%, which it accepted, and I've now got a file size of 1.3MB.
    So I guess I've got what I wanted - not that I really understand it, because 'original size' clearly isn't original size at all!
    Sorry Leonie - I didn't answer your question - they haven't given me a specification for pixel size as in 4288 x 4288: only 300 & 72dpi, a file size of 1-3MB, and a they must be JPGs.
    And thanks for your help Frank - I've tried starting out with JPGs and with TIFFs as the photographer supplied me with both. I'd cropped some of the images but not others. I appreciate you offer of having a go with my images, but I think that - as I can go to over 100% - I've got it sorted now! Just hope there's no deterioration in image quality.
    Many thanks everyone!

  • Is it possible to scipt "save for web" in a specific file size?

    The question says it all.
    i want to automatisate the last step of my work.
    it needs to save my work as a jpg in a specific folder with a maximum file size (82kb) ...
    how can i achieve this step?
    Thanks for you help

    I wanted to get snarky about doing a Forum Search before posting, because I have the feeling this has been treated more than once … but I can’t currently find the threads, either.
    As far as I can tell the task requires saving, checking the resultant file’s size, if it offends save again with different settings, check … until the requirement is met.

  • Exporting with specific file size possible ?

    Hi,
    say I have master files in the region of 50 - 350Mb and need to upload the versions at best possible JPEG quality with a file size restriction of say 8Mb.
    How would you do this straight out of Aperture ?
    AppleScript ?
    Thanks for any pointers,
    chris

    Thanks Ian,
    I thought so.
    If anybody could point me to a nice AppleScript/Automator workflow that could help me with full size exports on Finder level, please let me know.
    Thanks a lot in advance,
    chris

  • How to monitor specific file size in SCOM 2012

    Dear Experts,
    In our environment we need to SCOM have monitor profile of NTuser.dat file growth in all citrix servers, This file is presented in the path of  “C:\Documents and Settings\ctx_cpsvcuser\NTuser.dat”. when this profile is reached 10 MB
    size then SCOM has to trigger the alert, So can you please help me out to achieve this Task. I have tried many scripts and no luck.. So please provide me step by steps to configure this.
    Saravana Raja

    Hi Yan,
    I have followed with Kevin steps with below model scripts and does not work it seems.Also I didn,t get any errors also.. I don't understand whats wrong there...
    Set objFSO = CreateObject(“Scripting.FileSystemObject”)
    Set objFile = objFSO.GetFile(“C:\Documents and Settings\ctx_cpsvcuser\ntuser.dat”)
    varSize = objFile.Size
    Dim oAPI, oBag
    If varSize > 52428800 Then
    Set oAPI = CreateObject(“MOM.ScriptAPI”)
    Set oBag = oAPI.CreatePropertyBag()
    Call oBag.AddValue(“Status”,”Bad”)
    Call oBag.AddValue(“Size”, varSize)
    Call oAPI.Return(oBag)
    Else
    Set oAPI = CreateObject(“MOM.ScriptAPI”)
    Set oBag = oAPI.CreatePropertyBag()
    Call oBag.AddValue(“Status”,”Ok”)
    Call oAPI.Return(oBag)
    End If
    Saravana Raja

  • Create/run Report on specific folder size on machines?

    Done some searching but can't seem to get a suitable solution for this. Essentially I want to run a report which will tall the the total size of a folder, if it exists, on all my machine. "C:\myprograms\tax". It's not in the user context which
    should make this somewhat easier?
    Does anyone know any relatively straightforward ways of getting a report on this?
    Thanks!

    ok; here's what I did in my lab (and it worked for me):
    1. Create a new ConfigItem -- check the box about "This Configuration item contains application settings".  For this example, I'm going to name it "InetPub Folder Size"
    2. Detection methods, use a custom script, powershell
       if (Test-Path c:\inetpub) {write-host exists}
    3.  Setting, New, Script, String data type, add script of Powershell.  I know your script appended "MB"; but I think from the standpoint of what I'd do with the data (potentially) once I get a report out, I'd want it to be just a raw number,
    so if I had to do stuff with that number in sql or excel, I don't have to strip out the MB part.  You'll know it's MB, right?
    if (Test-Path c:\inetpub) {
    $colItems = (Get-ChildItem c:\inetpub -recurse | Measure-Object -property length -sum)
    $result = [int]($colItems.sum / 1MB)
    write-host $result
    4.  Compliance Rules; Value EQUALS the phrase  "Report Any Value" 
    Since it will never ever return that result, everything will be a non-compliant (which is what we want)
    5. Supported Platforms: select all or just select the OS' you care about.
    6.  Create a baseline (name doesn't matter), add this CI to it.  after you add it, make sure you change Purpose from "Required" to "Optional".
    7. Deploy the Baseline on a (for example) daily re-run schedule to a collection--probably just a test box for now.
    8. Bunch of policy refreshes, and interactively run the baseline.  in the control panel applet, it SHOULD say it's non-compliant.  Locally check the report there, see what the results are (just so you see it working).
    9. in SQL Management Studio (might take a few minutes for the non-compliant value to show up from the client through your MP into your database, i.e., wait 15-20 min maybe), run this against your CM_ database:
    select
      s1.netbios_name0,
      ci.displayname,
      rooles.RuleName,
      perclientdetails.DiscoveredValue
    from
    v_localizedciproperties ci
    join vDCMDeploymentNonCompliantRuleDetailsPerClientMachine perclientDetails
     on perclientdetails.ci_id=ci.ci_id
    join v_CIRules rooles on rooles.rule_id=perclientdetails.rule_id
    join v_r_system s1 on s1.ResourceID=perclientDetails.ItemKey
    where
      ci.displayname = 'InetPub Folder Size'
     and
     ci.localeid = 1033
    order by s1.Netbios_Name0
    Standardize. Simplify. Automate.

  • Compress to fit a specific file size

    Hello everyone. I'm new to these parts of town, anyway. I was wondering if anyone can help me out.
    I have a 5 minute video that I want to put onto youtube.com.
    Youtube has a 10minute/100mb limit for it's users.
    My problem is, how do i convert my 5 minute video to utilize the full 100mb that youtube has to offer.
    The reason I want to utilize the 100mb is because i notice that the bigger the file, usually the quality is better.
    Is there a mathematical equation that i can use to help me do this?
    I'm using Final Cut HD. Thanks ahead of time.

    http://www.mpegx.com/cat.php?dcat=VideoCalculator has some bit rate calucators to help out here... there's an MPEG-4 calculator I noticed there...
    Jerry
    Welcome to the forum!

  • Automator pdf reduce file size action

    I have a saved action to reduce file size  for pdfs and want to change the resolution, but it's grayed out. Can someone tell me how I can do this?
    Thank you!

    Cathy,
    You have posted your question in a forum dedicated to the Final Cut Studio application Color. It is a very specialized program to grade (adjust) the color in video/film images. We know nothing regarding PDFs.
    Have you tried posting this on an Adobe support site?
    Good luck,
    x

  • Choosing an optimal size ( file size, MB's,tiff or jpg) for iphoto

    I apologize to Old toad and others who have responded. OT seems to be the only one who answers so much. He deserves a standing ovation which i am giving him now.
    But:
    Lets start at the beginning. I am a semi-pro (i do not make my living on my photography) who never used Iphoto but must now because i wish to create a 100 page book.
    I have files mostly tiffs that range from 17.2 to 60 MBs in size ( 3008-5000 /2000-3000 dpi ). I see that Iphoto ad nauseum creates a thumbnail, and a copy of the original photo for each photo. This is not HD friendly.
    How big in pixel size/file size in MB's should the files be so that i do not use so much HD space? Should i just go ahead and drag the files that i have and allow for 5-10 GB of photos to accumulate on my HD? I realize i do not need
    my files so big and that is why i ask here in the forums.
    I realize most of my files are non compressed tiffs,i.e. big in file size.
    What say you? Please be specific. Mention a specific file
    size in MB's please
    thanks

    Glen:
    I've created several books. They were with cameras that produced 1600 x 1200 pixel image files which will give a maximum 300 dpi size of 5.3 x 4 inches. All of my books have been the Storybook theme so the one photo per page is not a full page and I've never run into the warning for low resolution. Possiblly a full 8.5 x 11 photo page would have given me a warning. For the intended use of the books I found them to be very good. My Canon camera's color profile is very close to the Apple recommended sRGB so I've calibrated my monitor with the sRGB profile. Any edits I do with Photoshop CS3 embed the sRGB profile in the resulting file.
    My current camera gives me 2272 x 2704 images. Haven't ordered a book since I've started using it but am in the process of creating one right now.
    It's not the MB size of the file that's important but the number of pixels in the image. For a full page photos, an image size of 3300 x 2250 would meet the optimal 300 dpi of the printing by Apple's suppliers. However, I have no doubt that my current camera's files would produce a good print at that size. That is if I got a good sharp image to start with.
    So a 3300 x 2250 pixel jpg would provide just as good a print as the same sized tiff. Just keep as many pixels in the image as you can. For those good photographers that can do their cropping when they take the image that will maximize the files pixels for printing. I don't have the eye for that. But then my photos are of rapidly changing family situations and I don't have time top compose the picture.
    I asked Apple about the printing and quality of materials used in the books and here's their replay:
    I contacted Apple and asked for information that I could pass on. Here's the reply I received from Apple:
    "Thank you for contacting the Apple Print Products Customer Service.
    I understand that you would like to know the printing process that is used and the color mode the files should be in, so you can better advise users in the iPhoto forum.
    iPhoto version 4 or later, allows you to import and print files through the Apple Print Product service as RGB, grayscale, or CMYK color space. JPEG files with RGB color space are recommended for best results.
    While iPhoto 2 can import files of various formats, including RGB color, grayscale, and CMYK, this version requires JPEG files with RGB color space when printing photos and books.
    For more information regarding iPhoto 2, please visit the following article:
    iPhoto: Color, Black and White Prints Appear Garbled or Distorted
    For more information regarding iPhoto 5, please visit the following article:
    http://docs.info.apple.com/article.html?artnum=165501
    Here are some of the technical specifications for the books, cards, and calendars. I hope this gives you an idea about their quality and form.
    BOOKS
    All iPhoto books are printed using acid-free paper for long-lasting image quality. The photos are printed at a high resolution (300DPI if you use iPhoto 6). There is no external modification--such as sharpening or contrast adjustment--of the photos; what you see in the application is what is printed in the book.
    Hardcovers Books
    The cover is hard-bound and covered in linen. You select the linen color during the book-ordering process. The hardcover books have a solid, stiff binding that is glued and crimped. The internal pages, measuring 8.5 x 11 inches, are printed on McCoy 100# Text Gloss paper stock.
    Softcover Books
    The softcover books come in three sizes:
    - Large 8.5 x 11 inches
    - Medium 6 x 8 inches
    - Small 2.6 x 3.5 inches
    All of the softcover books have internal pages that are printed on McCoy 100# Text Gloss paper stock. The large softcover book has a white cover (Kromekoteplus Folding Cover, 16 point) with a cutout on the front that reveals the cover-page photo in the book. The covers for the medium and small softcover books have the cover image and title printed directly on the cover. All of the softcover books have a glued binding and feature a thick cover of McCoy 100# Cover Gloss paper stock.
    CARDS
    All cards are printed on McCoy 120# Silk Cover paper stock. The postcards measure 4 x 6 inches, and the greeting cards measure 5 x 7inches.
    CALENDARS
    All calendars measure 8 x 10 inches and are printed on McCoy 100# Silk Cover paper stock.
    To ensure the best print quality, we have chosen to use Kodak NexPress technology. The press uses a dry toner, which is fused to the surface of the paper. Please see NexPress' site for more information:
    KODAK NEXPRESS 2500 Digital Production Color Press
    I hope you find this information helpful in answering questions on the iPhoto forum."
    As Apple stated, I hope this information is helpful.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    MBP 2.16Ghz; G5 Dual Core 2GHz, 2G RAM ea, 250G HD; G4 Dual 1Ghz, 1.5G RAM;   Mac OS X (10.4.10)   22" LCD, 710G FW HDs, Canon: SD700IS/i850/LIDE 50, Epson R200, 30G iPod, 2G Nano

  • Constraining file-sizes in iPhoto 6

    Is it possible to export a file under iPhoto 6 such that it is constrained to a specific file-size? Such as, if I import a 1 MB file and I want to export a copy that is only 500K in size, does iPhoto have this ability? I see where I can constrain the dimensions of the image, but not the size of the file itself.
    Any ideas?
    --- Chris
    G5, dual 1.8   Mac OS X (10.4.6)   It's shiny.

    HI Chris,
    If you have no other image editing software, you can try this on PREVIEW.
    Open images in PREVIEW and use the SAVE AS option > you'll see a dialog box, use jpg format, and you will also see a "Quality" slide, move more to left to make file smaller... and save to desktop with a NEW NAME. You will need to practice to get the correct file size you desire. After saving as, image will auto open again in PREVIEW, use the 'Get Info' for final file size, you can determine how much more or less you need...
    This is you only option if you need orginal resolution size but smaller file size and you do not have additional image edting software... practice makes perfect...:-)
    Rick
    iMac G5 iSight 20" - 30G iPOD in Slimming Black -   Mac OS X (10.4.7)   - HP Pav 15" WS and Toshiba Sat 17" WS LP's - Canon 20D & A620

  • SaveEPSOptions CS3/CS4/CS5 file size

    I have a script which saves multiple files as EPS format, and everything works well under CS3 and CS5, but when run in CS4, the file size is about 3X the size of the other versions. (1.3M in CS4; 300-400k in CS3/CS5). Is this a known issue in CS4, or is there some way I can work around this (other than checking the application version and disallowing saving in CS4)? Below are the saveEPSOptions I am using:
    var saveEPSOptions = new EPSSaveOptions
    saveEPSOptions.cmykPostScript = true
    saveEPSOptions.compatibility = Compatibility.ILLUSTRATOR12
    saveEPSOptions.embedAllFonts = true
    saveEPSOptions.includeDocumentThumbnails = true
    saveEPSOptions.preview = EPSPreview.TRANSPARENTCOLORTIFF
    saveEPSOptions.saveMultipleArtboards = false // Added for CS4/CS5

    Mac running OSX
    Background image "placed" into new document
    Brush created with an image file of a sequin to make texture layers in order to create a beading pattern.
    Don't know how to answer your last comment, only in terms of what I want it to do, which is to create an editable file that the layers can be changed, textures altered or added to the basic image background.
    Shane Davis
    [email protected]

  • Knowing File Size Prior to Exporting

    With the advent of youtube etc which limits file size to 100mb is there a way to calculate the file size prior to export?
    Even better is there any way, maybe a plug in that you can aim for a specific file size, say 99.9mb and the codec would meet that target size keeping the VDO at the best quality possible within those parameters???
    Thanks,

    Sounds like an interesting project for one of the shareware companies.......anyone??

Maybe you are looking for

  • HP ENVY 700-210xt changed the case. Wifi adapterworking but can't find my network

    Hi all, I just changed the case of my  HP ENVY 700-210xt and now my wifi adpater cannot find my network. I work as an IT so I have done this before many times but this is weird. The adapter is detected by the OS. I installed the newest drivers with a

  • Have tried all solutions listed on this board to A/V chat (unsuccessful)

    I have read practically every post on a -8 or -22 error, have opened every AIM/iChat port imaginable, done the same on the computer i am trying to connect to, opened all ports possible on my Mac firewall, opened all ports on other computers McAfee fi

  • I installed two 512 dimms of RAM and now my monitor doesn't work!

    My G5 tower came stock with 2 dims of 256K. I just installed an additional two 512 Dimms and turned on the computer, only to find that there is now NO picture! I took out the dimms and turned it on with just the originals installed and same thing. I

  • Refresh database to previous incarnation

    Hi All, we have one request that is we need to refresh the database to previous incarnation. i need to refresh the database to 1july 2009. I have the incarnation dbinckey on 25th june and the second resetlogstime dbinckey on 23 may 2008. By mistake i

  • Configuring Proxy Service for MQ Transport

    Hi When we configure a MQ Proxy service, we get an option by the name "Endpoint URI 'GET' options ", I wanted to know what is the default setting for this option, i.e if i do not set anything in this tab then what value OSB defaults it to? Its Urgent