Save jpeg files and close script

Hi all

I am very new to scripting (from this morning) and struggling to get my head round if the following is possible. My apologies if I'm missing something basic.

I wish I could have a script that opens a jpeg image, insert the name of the file on the image, save as a jpeg and close.

I managed to find examples of this and currently have a script that will open the image, insert the name of the file and save the file - but as a photoshop document. I am also very keen on the images I need to process about 200 images in a closing time and and at present can do a little at a time.

I inserted what I have so far below... Any help would be appreciated.

/*

Description:

This script is a script of model that will

open and process a folder of images

*/

turn on double click of the

Macintosh Finder or Windows Explorer

#target photoshop

Make Photoshop the frontmost application

where we double clicked on the file

app.bringToFront ();

///////////////////////////

SET - UP.

///////////////////////////

A list of file extensions to ignore, keep them lower case

gFilesToSkip = Array ("db", "xmp", "thm", 'txt', 'doc', 'md0', "tb0", "adobebridgedb", "adobebridgedbt", "bc", "bct");

POPs open a dialog box to the user of

Select the documents folder to process

var inputFolder is Folder.selectDialog ("select a folder of documents to process");.

///////////////////////

HAND / /.

//////////////////////

Open a folder of Images

OpenFolder();

display the path to a folder on exit

Alert (outputFolder);

///////////////////////////

FUNCTIONS.

///////////////////////////

Given to open a folder of files,

function {OpenFolder()

var filesOpened = 0;

List of files of the var = inputFolder.getFiles ();

for (var i = 0; i < fileList.length; i ++) {}

Make sure that all the files in the folder are compatible with PS

If (instanceof file in the list of files [i] & &! .hidden fileList [i] & &!) IsFileOneOfThese (list of files [i], gFilesToSkip)) {}

Open (fileList [i]);

filesOpened ++;

/////////////////////////////////////

Put all your processing functions....

/////////////////////////////////////

var originalUnits = app.preferences.rulerUnits

app.preferences.rulerUnits = Units.PIXELS

app.foregroundColor.rgb.red = 255

app.foregroundColor.rgb.green = 255

app.foregroundColor.rgb.blue = 255

Add the position of pixels for the left side of your block of text below

var textLeftPosition = 260

Add pixels to the bottom of your block of text below post

var textBottomPosition = 260

var typeLayer = app.activeDocument.artLayers.add ();

typeLayer.name = app.activeDocument.name;

typeLayer.kind = LayerKind.TEXT;

typeLayer.textItem.size = 48;

typeLayer.textItem.position = [textLeftPosition, textBottomPosition];

var NomCouche = typeLayer.name

typeLayer.textItem.contents = NomCouche;

app.activeDocument.close (SaveOptions.SAVECHANGES);

}

////////////////////////////////////////////

.. .in the area between these two comments. //

////////////////////////////////////////////

}

}

given a file name and a list of extensions

determine if this file is in the list of extensions

function IsFileOneOfThese (inFileName, inArrayOfFileExtensions) {}

var lastDot = inFileName.toString () .lastIndexOf ('. ');

If (lastDot ==-1) {}

Returns false;

}

var strLength = inFileName.toString () .length;

var extension = inFileName.toString () .substr (lastDot + 1, strLength - lastDot);

extension = extension.toLowerCase ();

for (var i = 0; i < inArrayOfFileExtensions.length; i ++) {}

If (extension == inArrayOfFileExtensions [i]) {}

Returns true;

}

}

Returns false;

}

All you need to do is create a small script to add a text layer.  Then record a script uses action.   The action by using the file menu, you can batch > Scripts > image processor.  In the dialog box image processor that it points to a folder that contains your source image files. They can be jpg or any other type of image file that is supported by Photoshop. Point to a folder to save the jpg files.  Set it to save file JPG (a resizing option settings). Point it at your action game and the text by adding the action.

Tags: Photoshop

Similar Questions

  • Script to save the file and close without user Interaction

    Hello

    I have a lot of script that closes a transform file, but it does not save the changes.

    I need the script to save the file and then close without user interaction.

    I looked at the script save slot, but this will require some user input.

    Can an advisor if please how to save and close the file without prompting can be reached?

    Script is the following:

    this.closeDoc (true);

    Look at the documentation for the saveAs method in Acrobat JavaScript Reference. This method is available in Adobe Reader for documents that have save the usage rights.

  • Close programs to prevent the loss of information. Your computer is low on memory. You save files and close programs. Java (TM) Platform SE binary Windows Media Player

    Hello

    I keep getting the following error message, and leterally having my computer off over and over again, even if I added 1 GB of RAM (now 3 total RAM) mor and also added a 8 GB SD card as more power:

    Close programs to prevent the loss of information.  Your computer is low on memory.  You save files and close programs.  Java (TM) Platform SE binary Windows Media Player

    I did research on the various search engines to know that many face the same problem, with a variety of possible solutions, but so far, none work.  We suggest that I go to Regedit and change the permissions of the user and then delete the old files, after I import them.

    Needless to say, I am just a user and have just a bit of technical knowledge.  The local PC repair shop in my town has no idea what to do.  For anyone who has a solution to this problem, help will be greatly appreciated!

    Randy Kline

    First of all, unless you know EXACTLY what you do and WHY you do it. I personally recommend never do anything in regedit. I consider myself a moderate to advanced computer user and a moderate user of windows. And I always stay away from regedit, if I can, because you can seriously screw things if you don't know what you're doing... Although, to be honest most of the settings will not have a devastating drama.

    It seems to me that this is a memory leak in the program, you will get this error message to make sure that your computer will just crash, because if she is running out of RAM... Well it will crash.

    If you have a 2 and a 1 GB for a total of 3 GB, I recommend the upgrade once more and just round up to a nice 4 (this is the most of memory a 32-bit system can handle in total)

    Works of memory in a way that you see really only a few performance jump with memory dual channel, the only way to have that is really striking the rods of same in each slot.

    There isn't really a reason that this happens every time, except that simply your computer is low on MEMORY, when your computer says this means RAM, not disk memory storage area.

    If you clean your computer of the programs you never use and stop using windows media player (itunes is better in my opinion, even if you don't have an ipod), you can see an improvement, but to really isolate the problem, I recommend simply opening your task manager as soon as you start your computer (ctrl + alt + delete usually gives you the option or it opens directly) otherwise you can do start-> RUN taskmgr.exe , OR type taskmgr.exe in the search box and press on enter.

    Then, look at the column of memory as I said it sounds like a program has a leak, and you will see that is because memory will begin at low/normal and then numbers just keep climbing...

    Also, make sure that your computer recognizes all 3 GB or RAM. in Task Manager if you have access to the performance tab, under physical memory must be a thing called Total, 3 GB = 3074. If this is not an option in your reason, you can go under Accessories/System Tools system information (on the start menu). (may take a while to load) but on the home page, you should see something that indicates the amount of TOTAL PHYSICAL MEMORY. You want to read this / 3GB or 3074 MB.

    Hope this helps some!

    I recommend to remove all programs, you are ready to, especially those that you never use. Do a complete uninstall. Then start installing windows clean (download google) just to make sure that the program has been removed. then go start--> run msconfig OR just type msconfig in the search and click on go (I don't know if you're running XP or Vista/7)

    In the msconfig dialog, you should see a section that says startup. Don't forget to remove programs that you do not first. Disable startup programs, you use every DAY. Don't go turn off all if windows needs some process to run, and some processes don't effect anything. But if you're curious, you should be able to google all of startup items and see what it's related to and why you do or that you don't need.

    Good luck! Sorry, I'm everywhere with this response.

  • Error message: to restore enough memory for programs running, save the file and then close or restart all programs

    It said "restore enough memory for programs to operate correctly, save the file and then close or restart all open programs".

    I changed the size of paging and says always the same, I have 1.5 GB free RAM, but don't know how to find or what to do 'virtual memory '.  Have windows 7.

    I started the safemode and run also memory dignostics and nothing found, please help, cannot afford to take a shop or get a new computer, I'm using another pc.

    I was recommended to download and. Run 'hitmanpro3'... but if anyone has had this problem and solved it or know how, please help!

    Thank you

    Hello

    Please contact Microsoft Community.

    I understand that you receive an error related to the lack of virtual memory. This error message appears when running any program that requires more memory your computer has, or running in the background, Windows manages the system memory by saving the data between physical memory and virtual memory. In order to help you better, please provide us with the following information:

    What is the brand and model of your computer?

    I suggest you follow the methods and check them off below if this solves the problem.

    Method 1: Clean boot

    A clean boot is a troubleshooting technique that allows you to get the computer facing up and running so that you can determine what elements of the normal starting procedure problems.

    How to perform a clean boot in Windows

    http://support.Microsoft.com/kb/929135

    Note: Once you are done with the clean boot, follow the section How do I reset the computer to start as usual after a clean boot troubleshooting under more information in the article to put your computer to normal startup.

    Method 2: Prevention of insufficient memory problems

    Follow the steps mentioned in the link and the check, it solves the problem. Follow the evolution of the size of the virtual memory section

    http://Windows.Microsoft.com/en-us/Windows/preventing-low-memory-problems#1TC=Windows-7

    Method 3: Virus Scan

    Microsoft Safety Scanner is a free burner that can be used to analyze a system for computer viruses and other forms of malware.

    Microsoft safety scanner

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Warning: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    Additional information: Windows optimize for better performance

    Hope this information helps. Response with status so that we can help you.

  • PhotoDraw in Windows7 - cannot open or save jpeg files

    I have managed to load Photodraw V2 on my new Windows7 machine, but cannot get the program to open or save jpeg files. I've uninstalled, reinstalled, repaired and added features (graphicthrough the control panel............... but no luck.) Any body can help?

    I've seen the same problem, but it is not related to Windows 7, I had also in Vista.  I followed up to the size of the file.  I can open small JPG images, but I started to have the question when I got a new camera.  Nothing does no more than 8 million pixels open in Photodraw.  I had to open the photo in another program, reduce the image, then it opens.  But that downgrade the photo.  For more pictures, I just had to use another program and not my beloved Photodraw.  I really wish that Microsoft had continued to work on this product because it was great!

  • How to open indesign files and close

    I want to open indesgin files exist in the folder I want to open all files one by one and I would like to conclude wht are the files I opened

    could someone tell me.

    You might want to be more explicit.

    I inserted "Close [Y/N]" because without this prompt, the script would do exactly what you ask: open all files and close them. Not very exciting, but if that's what you need, just remove the line 12 "if (confirm (" Close "+ str") == true).

  • Duplicate images that appear in folders bearing the name of file to a format like: Picon.rlf 2, 44-33. They are JPEG files and no more than 10 KB

    Original title: duplicate images on file

    In the photo and Documents folders, duplicate pictures are appearing with the filename of a format like: Picon. RFL 2, 44-33. They are JPEG files and no more than 10 KB

    What are these files?

    My first thought would be a kind of thumbnails, but I checked the settings file and folder and it is on do not show hidden files / folders or operating system files.

    Ideas of what they are and what they could be removed would beappreciated.

    Thank you very much

    Ruudi

    Mystery solved:

    http://h30434.www3.HP.com/T5/Home-Web-printing/thumbnails-appearing-in-folders-Picon-RLF-x-XXX-XX-jpg/m-p/916859#M4714

    Thank you

    Ruudi

  • How to edit a jpeg file and add captions and save it again as a jpeg?

    I open a jpeg file in Acrobat Pro XI and edited the photo by adding captions. Once again, it has been saved in PDF format and when reopened all the legends where he.  I tried to save it as a jpeg and when repoened all legends have disappeared.  How can I save the file as a jpeg and have the legends show?

    Hi Firepros1,

    You try to export the file in PNG or TIFF instead of jpeg.

    Let me know if this helps.

    Kind regards

    ~ Dominique

  • How to change a photo that has been edited from Photoshop Elements psd file in a jpeg file and always keep "layers" or RGB functions that were suppose to be included and automatic with this program.

    When I try to 'save' the photo, I get a warning popup, saying only save as copy, as jpeg will not support the "layers".  The site that I want to download my photos requires jpeg only, but it must have space color Adobe RGB or sRGB...

    suezans89729982 wrote:

    When I try to 'save' the photo, I get a warning popup, saying only save as copy, as jpeg will not support the "layers".  The site that I want to download my photos requires jpeg only, but it must have space color Adobe RGB or sRGB...

    Your thread earlier today deals with the question of the layers, the JPEG file format is not supported. If you want to save the file with layers, save as PSD. To load the referenced site, save the file in JPEG format as well. After you have downloaded, remove the JPEG file if you are short of space.

    Go to Image > mode and make sure the RGB color is checked. When you go to file > save as, in JPEG, the ICC profile is sRGB IE C61966 - 2.1 (on my current test file).

  • How to save JPEG files in PSE5.0?

    Ok. Newby Q again.  How the hell do we know what to choose when it comes to saving an image in JPEG format?  the following three boxes will appear:

    IMAGE OPTIONS:

    QUALITY >

    FORMAT OPTIONS:

    REFERENCE >

    PROGRESSIVE >

    SIZE:

    up to 2 Mbps?

    As a general rule, if you are going to archive your photos in JPEG format, you want to save in top quality as possible. It would be with the slider to the right or the number "12".

    Usually, "Standard" would be the way to go. He wrote the photo in a single pass on the screen.

    "Progressive", wrote the photo 3-pass across the screen and is usually used to download and view files in a web page.

    The dialog box of 'size' you refer gives you the approximate time (in seconds) you need to download the internet photo with 56.6 bps. (dial up) At least the weather is referenced for dial-up internet to the PSE5. If the speed dialog box gives you this information, [1]; size of the photo (in KB) [2]; time to download (in seconds), [3], internet high speed of reference.

    If you are considering a re-editing your photos at a later date, consider saving in a lossless format. The PSD and TIFF file formats support save layered and don't 'compress' the file whenever it is worked on. "PSD" is the native format of Photoshop, so it could be argued that it would be the better of the two. Since a scanner mode "Lossless" would save in TIFF, Photoshop would need convert PSD files. A jpeg file would be better suited to a photo in which the editing process has been finalized and is heading to the printer, or maybe aunt Martha in an E-mail.

    One last thought is that the quality allows you to "jpeg", a file and the size of the file itself, is largely dependent object. For example a photo that you intend to make public on "Flickr" must be sized down and and jpegged to average quality. Present in case the photo is uploaded, your work will not be in full resolution and quality, therefore limiting its usefulness to viewing only. In any event, a photo uploaded on the web absolutely must be a COPY, not to alter the original in the way that I have described.

  • How to make windows Picture Manager program by default to open jpeg files and how do I email photos smaller, so they don't take so much space?

    When I try to open a jpeg file, I get an error message... Acrobat Reader cannot open file... so I have to right click on each photo and open with Windows Picture Manager.  I want to be able to open a JPEG with a single click.  Also, I want to be able to send smaller photos so that they are sent faster and do not require a lot of time the receiving computer to get... Thank you.

    I'm guessing that the regfix didn't work?

    Outlook or Outlook Express? In any case... when
    attaching directly to an e-mail message, do you
    don't see no dialog resize.

    The following free PowerToy for Windows XP
    can resize batches of photos very quickly:

    Click on the following link and the left click of the
    Tab "PowerToys"...

    Windows XP downloads
    http://Windows.Microsoft.com/en-us/Windows/downloads/Windows-XP

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

    Download and install: ImageResizer.exe
    (Filename: ImageResizerPowertoySetup.exe)
    (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.

  • I export to a jpeg file and add to the cat but if I do a sync after that he wants to delete it

    If I export a raw to jpeg format in the same folder update catalog it all works, but if I do a sync folder after who want all my exported jpeg should be deleted.

    Our administrator of the LR group tried this as well and got the same results. I'm on 5.7.1 on 5.2 and we both experienced users. Because normally I export my JPEG files in a separate folder in the catalog I didn't notice it earlier, but I was actually a test for a user with a similar problem involving edit in PS and lose the tif.

    Synchronization of folders is sort of an IMPORT statement so maybe he respects the parameter "treat JPEG files files next to raw as separate photos" in the preferences.   Put him in power and see what happens.  With it turned off the synchronization will delete the Lr jpg file as you say.  With the preference off she probably should remove the photo even if there is a setting to not to in the Synchronization dialog box.  I didn't test too as far as my workflow does NOT keep jpg is the same folder as the RAWS.

  • Need to re install my Windows 7 do I need to "save my files and programs?

    Problems with Win7, but I like him and I drive so I want to re install. I have to save my docs and programs like Acrobat, etc.?

    You need to back up everything.

    Perform a full backup that includes the image of 'data' and the system.

    Create a system repair disc.

    In any case, backups must be performed on a regular basis. A system repair disc should always be at hand.

    Programs need to be reinstalled, so you must have the installation diskettes or the way of installation which may exist as a download and all associated passwords or serial numbers.

    What problems are you having?

  • Why my pictures not saved with the extension of jpeg file and how do I get back them without all these numbers that are displayed

    photos that I can see are marked differently as in this example

    3D 18805-DC2C-4AOF-B308-FESCCEC3A61

    Hello

    We would like to provide you with more information about the issue by answering the questions below:

    • What is the program you are using that allows you to see the name of the .jpeg files in

      3D 18805-DC2C-4AOF-B308-FESCCEC3A61?

    • What type of program you use in editing photos?
    • What are the steps you take in the mounting of the .jpeg images?

    Thank you!

  • Your computer is low on memory. To restore enough memory for programs running, save your files and then close or restart all open programs.

    I don't understand what I have to do. I don't have any open programs or files.

    Hello

    Thank you for using the Microsoft Windows Vista Forums.

    Follow the instructions in the links below that may help you resolve the issue.

    Prevention of problems of memory

    http://Windows.Microsoft.com/en-us/Windows-Vista/preventing-low-memory-problems

    Optimize Windows Vista for better performance

    http://Windows.Microsoft.com/en-us/Windows-Vista/optimize-Windows-Vista-for-better-performance

    Please post back and let us know if it helped to solve your problem.

    Kind regards

    KarthiK TP

Maybe you are looking for

  • Grand Theft Auto IV video card driver-

    I just bought grand theft auto IV and loaded on my computer, when I start the game, but it is said that it was "impossible to create depth render target - please re-install DirectX and/or install the latest graphics card driver. I reinstalled directx

  • Had a recent fall and rebuild and don't get 'My recent Documents' show more when 'Start' is clicked.

    Original title: my recent Documents Had a recent fall and rebuild and don't get 'My recent Documents' show more when 'Start' is clicked. Floowed instructions in 'HELP' to customize, Advanced and list but do not work. Help please. Thank you Bill

  • In camera on Vista Home 1st round

    Of the repalce the dirve hardd on top of a tower of Toshiba with AMD 64-bit processor. No disks provided with the laptop had to borrow a 32-bit version of Vista Home drive. Install goes fine, but when Vista runs for the first time, the OS crashes wit

  • Inspiron 3650 SATA power cable

    I want to add a new hard drive to my new Inspiron 3650. I have the sata cable, but looks like I need to buy a power cable. What I should buy and where can I get a? Thank you

  • BlackBerry Q10 Q10 - voicemail

    Hi, someone told me that when she calls me on my Q10, it goes straight to my voicemail. How can I fix it? Thank you Ho!