Photoshop CS 2 Automatically View>actual pixels at 100%

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

Moderators: Tom, Kukurykus

Larry Ligon

Photoshop CS 2 Automatically View>actual pixels at 100%

Post by Larry Ligon »

This script will automatically resize the image to actual pixels at 100% after opening a document. When the “View>Actual Pixels” is selected, the window doesn’t open to its widest possible size. This script will “View>Actual Pixels” and expand the window to its widest point. When this script is attached to the document open event in Photoshop CS 2, the script will, in effect, be executing “View>Actual Pixels” followed by “View>Fit on screen” menu function automatically.

See the Read Me.pdf for instructions on how to install and use this script.

bb/download.php?id=11
Larry
MickM

Photoshop CS 2 Automatically View>actual pixels at 100%

Post by MickM »

Larry

I'd assumed you must have got this code from using the ScriptListener but then I tried it and the SL doesn't record this. Would you mind sharing how you figured out how to do this in code without using the SL. Very impressive.
Andrew

Photoshop CS 2 Automatically View>actual pixels at 100%

Post by Andrew »

Hope you don't mind my butting in here Larry

This is part of my rawreview js which allows a wide range of viewing options for the open document. As you can see it is based on the ScriptListener.

Code: Select allfunction imageView (view)
{
var id73 = charIDToTypeID( "slct" );
    var desc17 = new ActionDescriptor();
    var id74 = charIDToTypeID( "null" );
        var ref13 = new ActionReference();
        var id75 = charIDToTypeID( "Mn  " );
        var id76 = charIDToTypeID( "MnIt" );
        if (view.length < 5) var id77 = charIDToTypeID( view );
        else var id77 = stringIDToTypeID( view );
        ref13.putEnumerated( id75, id76, id77 );
    desc17.putReference( id74, ref13 );
executeAction( id73, desc17, DialogModes.NO );
}

imageView('ActP'); // 100%
imageView('FtOn'); // equivalent to Ctrl0
imageView('ZmIn'); // zoom in
imageView('ZmOt'); // zoom out
imageView('screenModeFullScreen');
imageView('screenModeStandard');


It is also possible to save your own PS workspaces and toggle these as you wish including closing the File Browser (or opening it) which can be useful sometimes.

Andrew
MickM

Photoshop CS 2 Automatically View>actual pixels at 100%

Post by MickM »

Andrew

I can see how it works but I still don't understand how you recorded that. What actions did you take to generate the code.
Andrew

Photoshop CS 2 Automatically View>actual pixels at 100%

Post by Andrew »

LOL you'll kick yourself - record an action with an open document, in the actions palette 'insert menu item', View >> Fit On Screen, check out script listener.

Andrew
Larry Ligon

Photoshop CS 2 Automatically View>actual pixels at 100%

Post by Larry Ligon »

Andrew has it right. This works for any menu item. Give it a try.

Larry
MickM

Photoshop CS 2 Automatically View>actual pixels at 100%

Post by MickM »

WOW! AMAZING! That is something I never knew before. I did wonder this morning when I looked at the code if it had something to do with Insert Menu Item but didn't check it. It opens up another world. I've always told people it wasn't possible to toggle rulers for example. Cheers guys.
Larry Ligon

Photoshop CS 2 Automatically View>actual pixels at 100%

Post by Larry Ligon »

Ain't science wonderful!!!

Larry
MickM

Photoshop CS 2 Automatically View>actual pixels at 100%

Post by MickM »

Yeah! And so is PS scripting.