CS3 Automate Plug-ins Scripts

Upload Photoshop Scripts, download Photoshop Scripts, Discussion and Support of Photoshop Scripts

Moderators: Tom, Kukurykus

jjmacks

CS3 Automate Plug-ins Scripts

Post by jjmacks »

In January I put together a package for use with Photoshop to help one automate printing standard sized images...

The package contains to Plug-in Scripts for CS3. Adobe added features to CS3 scripting which makes it possible to create Photoshop Plug-ins. In fact Adobe changed their compiled Fit Image Plug-in into a Script. In doing so Adobe also introduced a compatibility problem. For when you record a action that uses a script the full path of the script get recorded into the action. This would require one to rerecord the action with each release of Photoshop. My package include instructions on how I address this problem by keeping my script in the file system outside of any Adobe tree and linking Adobe tree to mine.

The package can be download from http://www.mouseprints.net/old/dpr/Crop ... cripts.zip ... cripts.zip

The Plug-in Scripts and Usage.
________________________

The two scripts included where modeled after a script that ships with Photoshop "Fit Image" fit image resamples an image and constrain its size to fit with the Pixel size set in Fit Image's dialog.

Fit Image is very handy when you create actions for making Web size images. My two scripts do not change any of the image's pixels. The Aspect Ratio Selection script just sets a selection of the requested aspect ratio fitted to the current image. It is up to what uses the script to do the actual crop.

The Long Side Print Length Scripts only changes the current documents DPI setting to print the image the desired requested size.

When installed the Aspect Ratio Selection script and the Long Side Print Length Scripts can be found in Photoshop's menu File>Automate>Script Name. These Scripts can be used within a Photoshop action. Setting used in the scripts dialog while recording the action will be recorded and used when the action is played back without showing any dialog. You of course can turn the Dialog Back on within the action to make it interactive.

The Aspect Selection Script is like using the Rectangle and Elliptical Marquee Tools with a couple of twist thrown in. The selection will automatically be sized to fit the image and can be centered. All the normal features of the marquee tools have been implemented. You can feather and anti-alias the selection. The selection mode can be new||replace, diminish||subtract, extend||add, and intersect. The selection can also be shrunk to allow a 25% border around the selection. Most of these features are not used by these actions.

Maybe you can come up with some uses for them.

The Long Side Print Length Scripts only changes the current documents DPI setting to so it will print the requested size. Though this is a very simple function the script is quite involved. To be able to pass parameters to a script the script needs to be coded in a very complex way and act as a Photoshop plug-in. The amount of work involved to do such a simple "If" then "do" else "do" turned out to be a file well over 400 line long. Thankfully most were stolen from Photoshop's "fit Image" script you got to love software reuse.

Finally a note regarding the script code. The code uses some strange strings that look like some kind of Photoshop registration number. I do not know how one would get such a thing. So I use the one that belong to "Fit Image" The only string I changes was the one "Fit Image" used to record and retrieve its parameters. My scripts work and do not interfere with "Fit Image". However I do not know if using "Fit Image's" registration number will not cause any problem sometime in the future.
xbytor

CS3 Automate Plug-ins Scripts

Post by xbytor »

jjmacks wrote:Finally a note regarding the script code. The code uses some strange strings that look like some kind of Photoshop registration number. I do not know how one would get such a thing. So I use the one that belong to "Fit Image" The only string I changes was the one "Fit Image" used to record and retrieve its parameters. My scripts work and do not interfere with "Fit Image". However I do not know if using "Fit Image's" registration number will not cause any problem sometime in the future.

The thing that looks like a registration code is actually a UUID. There are several places on the net to have a unique on generated for you. I get mine here:
http://www.famkruithof.net/uuid/uuidgen

-X
jjmacks

CS3 Automate Plug-ins Scripts

Post by jjmacks »

Thanks