Ashamed to ask and probably missing basic knowledge, but I can't find any helpful reference on how to implement using MagnificationType.FITPAGE and MagnificationType.ACTUALSIZE on a document...
Script Listener doesn't seem to give anything, so what I hoped for is something like this:
Code: Select allvar srcDoc = app.activeDocument;
srcDoc.magnification = MagnificationType.FITPAGE;
or
Code: Select allsrcDoc.magnification[MagnificationType.FITPAGE];
Etc. No luck so far...
ActualSize and FitPage
-
txuku
ActualSize and FitPage
Bonjour
You can see HERE
and use Code: Select allvar options = new PresentationOptions;
You can see HERE
and use Code: Select allvar options = new PresentationOptions;
-
Skrippy
ActualSize and FitPage
Merci.
It's a hint I can't get working though...
Stuck with[?]:
Code: Select alloptions.magnification = MagnificationType.FITPAGE;
So I've gone to using actions from a script:
Code: Select allif ( imageX > 952 || imageY > 888 ) {
doAction("- fit on screen","helper actions");
}
else
{
doAction("- actual pixels","helper actions");
}
It's a hint I can't get working though...
Stuck with[?]:
Code: Select alloptions.magnification = MagnificationType.FITPAGE;
So I've gone to using actions from a script:
Code: Select allif ( imageX > 952 || imageY > 888 ) {
doAction("- fit on screen","helper actions");
}
else
{
doAction("- actual pixels","helper actions");
}
-
larsen67
ActualSize and FitPage
Are you wanting to make a presentation or are you just wanting to set the Active Document's view state…?
-
Skrippy
ActualSize and FitPage
Just wanting to set the Active Document's view state...
I'm ok with what I have now, but useful to add for others or the future, if you know how?
I'm also wondering if I can "softcode" the dimensions for my "viewport"...?
The (imageX > 952 || imageY > 888) pixels is what I normally have free to view pics in.
Would be nice if it was not hardcoded.
I'm ok with what I have now, but useful to add for others or the future, if you know how?
I'm also wondering if I can "softcode" the dimensions for my "viewport"...?
The (imageX > 952 || imageY > 888) pixels is what I normally have free to view pics in.
Would be nice if it was not hardcoded.
-
larsen67
ActualSize and FitPage
Then see this previous thread it covers all the options available to photoshop…
bb/viewtopic.php?f=9&t=4774&p=23930&hilit=fton#p23930
bb/viewtopic.php?f=9&t=4774&p=23930&hilit=fton#p23930
-
Skrippy
ActualSize and FitPage
Good hints. Thanks!
I expected these to work, but they give me an error "Numerical value expected"...
Code: Select allrunMenuItem( "ActP" ) ;
// or
runMenuItem( "FtOn" ) ;
function runMenuItem( item ) {
cTID = function(s) { return app.charIDToTypeID(s); };
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( cTID( "Mn " ), cTID( "MnIt" ), cTID( item ) );
desc.putReference( cTID( "null" ), ref );
executeAction( cTID( "slct" ), desc, DialogModes.NO );
}
I expected these to work, but they give me an error "Numerical value expected"...
Code: Select allrunMenuItem( "ActP" ) ;
// or
runMenuItem( "FtOn" ) ;
function runMenuItem( item ) {
cTID = function(s) { return app.charIDToTypeID(s); };
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated( cTID( "Mn " ), cTID( "MnIt" ), cTID( item ) );
desc.putReference( cTID( "null" ), ref );
executeAction( cTID( "slct" ), desc, DialogModes.NO );
}
-
Mike Hale
ActualSize and FitPage
Two things. Unless you are using an old version of Photoshop you don't need that function. runMenuItem() has been an app method for the last few versions.
But either expects a menuID which is numeric. Try
Code: Select allrunMenuItem( charIDToTypeID("FtOn") );
charIDToTypeID converts a four char string into a number. In this case a number that is the menuID for Fit on Screen.
But either expects a menuID which is numeric. Try
Code: Select allrunMenuItem( charIDToTypeID("FtOn") );
charIDToTypeID converts a four char string into a number. In this case a number that is the menuID for Fit on Screen.
-
Skrippy
ActualSize and FitPage
*Aaaargh* Thx!
I had just found another vintage solution:
Code: Select allchangeView( "FtOn");
// or changeView( "ActP"); etc.
function changeView( ID ){
try{
var id240 = charIDToTypeID( "slct" );
var desc65 = new ActionDescriptor();
var id241 = charIDToTypeID( "null" );
var ref53 = new ActionReference();
var id242 = charIDToTypeID( "Mn " );
var id243 = charIDToTypeID( "MnIt" );
var id244 = charIDToTypeID( ID );
ref53.putEnumerated( id242, id243, id244 );
desc65.putReference( id241, ref53 );
executeAction( id240, desc65, DialogModes.NO );
}
catch(e){}
}
I had just found another vintage solution:
Code: Select allchangeView( "FtOn");
// or changeView( "ActP"); etc.
function changeView( ID ){
try{
var id240 = charIDToTypeID( "slct" );
var desc65 = new ActionDescriptor();
var id241 = charIDToTypeID( "null" );
var ref53 = new ActionReference();
var id242 = charIDToTypeID( "Mn " );
var id243 = charIDToTypeID( "MnIt" );
var id244 = charIDToTypeID( ID );
ref53.putEnumerated( id242, id243, id244 );
desc65.putReference( id241, ref53 );
executeAction( id240, desc65, DialogModes.NO );
}
catch(e){}
}
-
Skrippy
ActualSize and FitPage
It's not working for the 3 latter ID's longer than 4 chars. Have these changed too?
Mike Hale wrote:here is a list of ID related to the screen menu.
"FtOn"
"ActP"
"ZmIn"
"ZmOt"
"screenModeFullScreen"
"screenModeStandard"
"screenModeFullScreenWithMenubar"
Mike Hale wrote:here is a list of ID related to the screen menu.
"FtOn"
"ActP"
"ZmIn"
"ZmOt"
"screenModeFullScreen"
"screenModeStandard"
"screenModeFullScreenWithMenubar"