I would like to fit text frames to their content (numbers from 1 to 31, 1 being much "horizontally" shorter than 25, for example).
Pressing alt + cmd + C only fits the height of the box, not its width. Is this intended to be that way? Can I change some setting so that the text frame fits exactly to the content, both vertically and horizontally?
winterm wrote:
If you want it "automagically", you need a script...
Not sure what you mean by that . Bothe the shortcut and the double-click onthe handle should be sizing the frame to fit without any script.
csmarisol12, have you tried trashing your prefs? see Replace Your Preferences
Well, I'm not sure if I'm not hurting the rules of the forum (there is special forum for scripting)...
However, here is the JS code I use for identical purposes, maybe you'll find it helpful:
/*
This script Fits Text Frames to Content
*/
myDialog = app.dialogs.add ({name:"Script going to start",canCancel:true});
with (myDialog)
with (dialogColumns.add())
// with (dialogRows.add())
{
staticTexts.add ({staticLabel:"This script will Fit Text Frames to Content."});
staticTexts.add ({staticLabel:"Proceed?"});
if (!myDialog.show())
{
myDialog.destroy();
exit(0);
}
}
var myTFs = app.activeDocument.textFrames.everyItem().getElements();
for (var i=0; i<myTFs.length; i++) {
myTFs[i].fit( FitOptions.FRAME_TO_CONTENT );
var gb = myTFs[i].geometricBounds;
while (myTFs[i].overflows) {
gb[3]++;
gb[2]++;
myTFs[i].geometricBounds = gb;
}
}
var _d = app.documents[0];
var _allStories = _d.stories;
for(var n=_allStories.length-1;n>=0;n--){
var _storyAllTextFrames = _allStories[n].textContainers;
for(var m=_storyAllTextFrames.length-1;m>=0;m--){
_storyAllTextFrames[m].select();
//Fit Frame to Content:
try{
app.scriptMenuActions.itemByID(11291).invoke();
}catch(e){};
//Deselect All
try{
app.scriptMenuActions.itemByID(278).invoke();
}catch(e){};
};
};
alert("Fit Text Frames to Content\nDone!");
I think I know what the OP means. This can be done with GREP styles. check out this article to see if this helps:
http://colecandoo.wordpress.com/2012/02/18/square-pegs-now-fit-into-ro und-holes/
North America
Europe, Middle East and Africa
Asia Pacific