PDA

View Full Version : Last framing script from me! Now with user sizes and colours.



tenchy
4th August 2009, 03:40 PM
This will be last version honest guv, promise!

Here is an updated v5 framing script based on one I posted some time ago with the addition of user selectable sizes and colours.
There are some limitations, in that any text added will be same colour as the inner border is set to, and also the relative positions of the logo and text are fixed, as is the text size. Turning these off gives you a great deal of freedom with the resizing.

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 as they are for frame width etc).
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.
Before saving, an Unsharp Mask is applied with either the default settings or from user input. Same settings are applied to all images, so as with any batch process some compromise needs to be made.
It will resize most images to be under the 170Kb limit for this forum. Some images with lots of detail throughout may need re-opening in Photoshop and saving with 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 from V4 (here http://www.photography-forum.org/showthread.php?t=34318) are:


User settable max image dimension range 100 to 9999 pixels inclusive.
User settable inner border width range 0 to 500 pixels inclusive.
User settable outer border width range 0 to 500 pixels inclusive.
User settable inner border colour using Windows colour picker.
User settable outer border colour using Windows colour picker.


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, they wil probably break the script!!!)

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 305)


//************************************************** ***************************************
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.

Screen grab of script to show what it looks like:
74110

Typical image output from settings above:
74111

Script to download:
74109

jemstar555
4th August 2009, 09:53 PM
I am getting this whenever I edit the file and try to save it:

http://www.photography-forum.org/importedimages/imported/2009/08/336.jpg

canon_shooter
5th August 2009, 12:58 AM
thanks much!!!easy and works a treat!!!

Karey:ok:

tenchy
5th August 2009, 08:25 AM
Jem, I've just loaded and saved the script into Extendscript with no issues.

The script is saved locally, and has write access, and Photoshop is not trying to use it?
That's all that springs to mind initially.

jemstar555
5th August 2009, 10:40 AM
Just can't edit the script. Tried Extenscript and Notepad and neither will save any changes I make. When I right-click on the file and select "properties", its not read-only. I have pressed "unblock" to allow the file to be opened on my computer as it says it comes from another computer and needs to be unblocked. All to no avail.

Apart from not being able to edit my personal details its a great script :)

Kenny
5th August 2009, 10:47 AM
Hi Steve

I initially managed to save the modified script and ran it but got an error on line 306.something about couldnt fetch copywrite? it said something about error 25:expected line 306 add copywrite info

Ive since been back and tried to redo the script and now it gives the same error as Jemstar reports.

Bessy regs

Kenny

Kenny
5th August 2009, 10:58 AM
panic over...twas me....I removed a pair of //'s I shouldnt have.

Im deffo going to follow on the web design course I did at the OU with a javascript course cos Id llove to create snazzy stuff like this...

thanks very much!

Bessy regs

Kenny

tenchy
5th August 2009, 11:40 AM
Np problem Kenny. BTW, whilst a javascript course is great in it's own right, the PSscript is different. Though, as a trained JS programmer, it would be much easier to do PSscript than not!

Jem, are you on Vista by any chance? Is it a rights thing?

You are editing a saved to disk version not double clicking the zip then double clicking the file and editing?

To use a phrase that our PCB software support team use too often for my liking,
"I cannot recreate the problem on my system" :)

jemstar555
5th August 2009, 02:22 PM
Tried everything, no joy :(

tenchy
5th August 2009, 02:39 PM
Without knowing your OS etc, I have no idea.

jemstar555
5th August 2009, 02:48 PM
Sorry, I'm on Windows 7 RC.

tenchy
5th August 2009, 10:30 PM
OOoer. Afraid I'm not familiar with the foibles of windows 7.
I would suspect either some privelidges or other security issue myself, as a guess.
I could upload a simple text file zipped tomorrow, to see if you can edit and save that?

Shane Lewis
17th August 2009, 10:41 PM
I have been wondering how people were getting those frames around their Pictures as it looks so much better .
Now I know and thanks for doing this .

I managed to change the font to one of my choosing but cannot work how I can centralise it in the frame . Is this possible ?

Shane

tenchy
18th August 2009, 08:26 AM
Untested, but try this
Change this (line 239)

activeDocument.selection.selectAll();
align("AdLf");

or this (line 253), depending an which you're changing

activeDocument.selection.selectAll();
align("AdRg");

to this:

activeDocument.selection.selectAll();
align("AdCH");

Stevepud
18th August 2009, 08:56 AM
Steve and Jem,

Win7 is a pig for security
I'm using 7 too, and will have a go at saving your script this morning.
I'll report back my findings, but would suggest this first....


Save the file to C:\temp
Make any edits to it that you require.

Then try to copy it to the correct location. (as indicated by Tenchy)
See what happens then.


Assuming you are using a personal PC and not a PC at work.
If no joy, the next thing, would be go to My Computer > C Drive
Right click it, choose Properties, Go to SECURITY Tab
Find your name in the GROUP OR USERS NAMES box, and single click it
Now check nthe box below that you haev ticks in all the ALLOW Permissions.

If not, press Advanced button
Find your name again in the Permission Entries box, single click it
Press CHANGE PERMISSONS button
Find your name again
Press EDIT (JEEZ Win7 is tiresome!)
Ensure that the APPLY TO option says This folder, subfolders and files"
Now put ticks in all boxes
Click OK


It may or maynot go and give you full permisson to the whole C drive now

If it does YAY, you're sorted
If not, you'll need to take owenership of the C drive first....

You ready....
go to My Computer > C Drive
Right click it, choose Properties, Go to SECURITY Tab
Find your name in the GROUP OR USERS NAMES box, and single click it
Press Advanced button
Click OWNER tab
Find your name in the CHANGE OWNER TO box,
Single click it
Press OK

It should go off and reassign the ownership to you

Try the script now,
If no good repeat the steps above that change the permissions.
SHOULD be OK after that. I think.... I'm sure thats what I had to do last time.


S

tenchy
18th August 2009, 08:59 AM
Thanks for that Steve!
I'll be sticking to XP Pro that little bit longer methinks!!!

Shane Lewis
18th August 2009, 09:54 AM
Thanks Steve (Tenchy)
I will try that out in a little while and see what happens .:)

Shane