I am here because I did not find solution.
Problem:
- I have 3 artboards.
- I need a script (or action) to "fit artboard on screen" or zoom in specific artboard.
- There is a option in top menu panel/View/Fit artboard on screen. It works well when I use it with mouse click.
But:
- When I try to record the
Action
:- Click on use
Insert Menu Item
:Fit artboard on screen
, press OK - Nothing is recorded in the action
- Click on use
- I also tried to click the menu item at
View > Fit artboard on screen
, but there is still nothing added to action panel during recording. - The last thing I tried was to use the Scripting listener plugin but it didn't output working code for this action.
- I can record
View > Fit on screen
as an Action, which fots all 3 artboards on screen and I need to focus/zoom in/fit on screen just one artboard.
This is code for action "Fit on screen". How could it be edited for "Fit artboard on screen"? Or is there another way to get my problem solved? Thank you all!
var desc12 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref3 = new ActionReference();
var idMn = charIDToTypeID( "Mn " );
var idMnIt = charIDToTypeID( "MnIt" );
var idFtOn = charIDToTypeID( "FtOn" );
ref3.putEnumerated( idMn, idMnIt, idFtOn );
desc12.putReference( idnull, ref3 );
executeAction( idslct, desc12, DialogModes.NO );
stringIDToTypeID(), charIDToTypeID(), typeIDToCharID(), typeIDToStringID()
, Unfortunately, you first need to convert to type id before you can convert to a string id:alert( typeIDToStringID(charIDToTypeID('FtOn')) );
, which would returnfitOnScreen
. If I'm not totally wrong, that code is basically saying Action:Select
From:menu > menuitem > fit on screen
. – Joonas Jan 25 at 12:16fitArtboardOnScreen
. – Joonas Jan 25 at 12:28