PDA

View Full Version : New framing script for Photoshop



tenchy
2nd June 2009, 10:28 AM
Here is an updated framing script based on one I posted some time ago.

This script will take any image size and resize it with a 2 colour border, place a title that comes from the filename in the left bottom of the frame, and add your logo to the right bottom corner of the frame.
The logo needs to be a PNG file, and about 14 pixels high, with my settings.
It will operate on a folder full of images, and do them all in a batch. You can specify a different output folder from the input folder (though I always use the same - put copies of the full size images in an empty folder called framed).
The script does not damage the originals, it only saves copied of them with the same filename but with '-framed' added to it.
It will resize most images to be under the 170Kb limit for this forum. Some images with detail throughout may need re-opening in photoshop and saving a bit higher compression.
My tests with 35meg TIF source files, all images with any blue sky in them came down to 130K to 160K, my 'old wood' image and a similar one came out at 200K so needed a re-save.
When you run the script in Photoshop (from File/Scripts) you need to close all open images beforehand.

Changes are:

Added auto fill of destination folder upon selection of source folder. This can still be overruled by simply using the destination browse button.
Added scripted stripping of ALL Exif data.
Added insertion of copyright and other information. As supplied the image will set the image status to copyrighted, and populate several fields as detailed below.

On a typical Windows based Photoshop CS3 system unzip this file into the following folder:
C:\Program Files\Adobe\Adobe Photoshop CS3\Presets\Scripts\

To cutomise this to your own requirements just open the file in notepad or other simple text editor (Word or wordpad not recommended!!!)

I've marked the sections of code with asterixes to make them easy to find.

This is the only bit that you will have to edit:
(It starts on line 188)


//************************************************** ***************************************
doc.info.author = "Your name";
doc.info.title = "Picture by your name";
doc.info.caption = "Please email you@your.address.com for any suspected copyright infringements."
//doc.info.captionWriter = "Your name"
//doc.info.keywords = ["Photo","Camera","Lens","Wedding","Portrait"]
doc.info.ownerUrl = "your email or website address";
//doc.info.city = "Bradford"
//doc.info.provinceState = "West Yorkshire"
doc.info.country = "England";
doc.info.copyrightNotice = "Copyright © your name 2009";
doc.info.copyrighted = CopyrightedType.COPYRIGHTEDWORK;
//************************************************** ***************************************

Just change the texts within the double quote marks. These are just suggestions, you can put what you want in.
The lines that start with // are disabled. To enable them, just delete the //, then edit the text within the double quotes.

Have fun.

Edit: replaced V2a with V2d from below

tenchy
2nd June 2009, 10:47 AM
Forgot that it also will put a watermark on if you tick the box and out text there.

Here is a sample image done with the script.
35Mb to 159Kb.

jemstar555
2nd June 2009, 11:38 AM
Excellent stuff, I shall be trying this very soon :)

Kenny
2nd June 2009, 12:02 PM
wow Steve!!!

thank you VERY much indeed!!!!

Bessy regs

Kenny

tenchy
2nd June 2009, 12:57 PM
No problem, you're very welcome.
If you need tips to slightly customise it just ask.

For example thicker white border, less black, colour changes etc.

Oh, just to say most of the original script, and the new copyright bits, are courtesy of Paul PMR (not sure of username now don't think he's here now). I've just added some bits and tweaked a few bits.

Dinnis
2nd June 2009, 01:42 PM
i get this error:

Error 8: Syntax Error.
line 1
-> {\rtf1\ansi\deff0{\fonttbl(\f0\fmodern\fprq1\fchar set0 Courier
New;}}

Maybe cause im using cs4?

tenchy
2nd June 2009, 02:02 PM
Ah, forgot to say I've only tested on CS3. The original scripts I posted before worked on CS2 I believe.
Will need to research CS4 compatibility.

tenchy
2nd June 2009, 02:10 PM
Dinnis, try this version please, and let me know.

Edit: replaced V2b with V2d from below

MaggieT
2nd June 2009, 08:20 PM
I tried the one above in CS4 but it says error 8800, not available for this version of photoshop

tenchy
2nd June 2009, 08:30 PM
Thanks Maggie.
I'll do some more research tomorrow to see if it's possible to make it work in CS4.

Ryna
2nd June 2009, 09:53 PM
Hi, I only have elements 7, do you know if a similar thing is possible for that? Cheers,

Dinnis
2nd June 2009, 10:47 PM
I ran it in Extended Script toolkit and it shows this line as an error

if(version.substr(0,version.indexOf('.'))>9){

Dinnis
2nd June 2009, 10:57 PM
Error 8800: General Photoshop error occurred. This functionality may not be available in this version of Photoshop. - The command "Transform" is not currently available Line 137 -> activateDocument.activatelayer.translate(25,-7);

it does every thing except save to be honest

would be good if you can make it so you dont HAVE TO add a logo

to be honest it isnt too hard to save it yourself though

tenchy
3rd June 2009, 11:20 AM
Dinnis:
Can you try something for me.
Can you download the second one again, put it in the scripts folder and run it exactly as it is, and let me know what happens. Ta.

jemstar555
3rd June 2009, 12:35 PM
Just downloaded the second version, ran it in CS4 and got this.

tenchy
3rd June 2009, 12:48 PM
Thanks Jem, you're a gem :)

I don't suppose you (or anyone) could try this one?
I'm not that hopeful it will fix the error, but for the CS2/3 users it will allow you to not have to use a logo (just don't browse for a logo, leave it empty)

Edit: replaced V2c with V2d from below

jemstar555
3rd June 2009, 01:03 PM
Downloaded version 2 and ran it.

I left the logo field blank (even though I'm using CS4) and it didn't have a problem with that.

Got this error this time:

tenchy
3rd June 2009, 03:37 PM
Ok, thanks Jem.
Here is another go at fixing the CS4 issue.
If someone could run it as downloaded (ie unedited with anything) in CS4 and let me know..

All works fine in CS3, by the way peeps.

Dinnis
3rd June 2009, 05:00 PM
script works PERFECT now (without editing)

but i am requesting how to change the output size to my normal size (1080x750 at 12 quality)
that way ill make a new script (rename) and ill use it for my original then for forum use ill use the one you made

tenchy
3rd June 2009, 05:08 PM
Cool. Result.

Ok, one thing.
The other errors you got I am sure were introduced by your editor.
What did you use?
Notepad (or Notepad++ even better) is def a safe option.
You can prove it by editting the last version (that works) to contain your copyright texts and see if it still works.

Anyway, the lines to change for the size are these, change the 750's to 1030.


// resize the image
if (file.width > file.height)
activeDocument.resizeImage(750, null, 72, ResampleMethod.BICUBICSHARPER)
else
activeDocument.resizeImage(null, 750, 72, ResampleMethod.BICUBICSHARPER);


For the compression level change the 5 below to a 12:


SaveJPEG(saveFile, 5); // save the new resized image

Dinnis
3rd June 2009, 05:19 PM
thanks =] great script :D save me soooo much time now

paulmag
3rd June 2009, 05:26 PM
Thanks for sharing the script :)

Now all I need is something worth posting :(

jemstar555
3rd June 2009, 08:44 PM
Works perfectly!!!

Many thanks indeed!!!

:)

jemstar555
3rd June 2009, 09:16 PM
Just noticed, the copyright symbol, name and date isn't appearing.

Any suggestions?

Thanks.

tenchy
3rd June 2009, 09:35 PM
Where isn't it appearing?

If you load it into Photoshop, first you should notice a copyright symbol in the title bar in front of the filename (well you do in CS3).
Then press CTRL+SHIFT+ALT+I all together.
You should the the fields that have been populated by the script after clearing out the rest.

jemstar555
3rd June 2009, 09:52 PM
All sorted :)

Thanks again!!!

tenchy
3rd June 2009, 10:03 PM
No probs, you're all welcome.

One thing. I couldn't find the right tags to put title etc that windows explorer uses,
but the main ones read by photoshop are better I think anyway.

tenchy
4th June 2009, 08:03 AM
Has anyone with CS2 tried the script by any chance??

Geordie_Aaron
7th July 2009, 09:54 AM
Hi, a question with this (brill script by the way)....i've edited the fields you've given, but instead of 'description of pic' IE 'the car' i've got the file name 'dsc00001' ETC???

any ideas?

regards
aaron

tenchy
7th July 2009, 11:16 AM
Aaron, I'm guessing you've slightly got wrong end of the stick.

The text to edit as shown above is for Exif data, which does not show up except when you look at the file's properties

However:

This script will take any image size and resize it with a 2 colour border, place a title that comes from the filename in the left bottom of the frame, and add your logo to the right bottom corner of the frame.

Is this where you are seeing the 'dsc00001' ?

You don't really want to edit the script for every image, else it kinda defeats the purpose of a time saving script, so I've found the best way is to simply rename the source images to suit, before running the script.

That's why in my example text above I have description set to
"Picture by your name", so ideally you just replace 'your name' with Aaron Surname'

Hope that helps.

Geordie_Aaron
7th July 2009, 11:54 AM
AHA! i'm with you now thanks - so where is the field that i can disable that feature? so it would just be black!?

regards
Aaron

tenchy
7th July 2009, 12:27 PM
I'll look at adding that in, watch this space!

Bucephalas69
7th July 2009, 12:33 PM
I'm running cs2 and get the following error message.......

tenchy
7th July 2009, 12:46 PM
Thanks for feedback
Can you try putting two forward slashes ( // )at beginning of very first line so it looks like this:

// #target photoshop
and let me know how you get on?

Geordie_Aaron
7th July 2009, 01:30 PM
haha legend - thought it would have been something i could have just '//' like the rest.... but guess not lol, no big deal though dont worry ?;-)

tenchy
7th July 2009, 01:35 PM
Fraid not, there are logic checks in which throw up error if stuff isn't set.
But I've put same tick box in for the logo, so it just needs a few tweaks and extras here and there.

beatlesusan
7th July 2009, 03:57 PM
How incredibly awesome! Thanks.

tenchy
9th July 2009, 02:17 PM
I'll look at adding that in, watch this space!

or more accurately, this space:

http://www.photography-forum.org/showthread.php?p=313318