Text adapted in proportion to the content - block
Hello
I created a few frames of text associated with a certain ratio aspect (height/width) that I want to retain after the application
myTextFrame.fit (FitOptions.FRAME_TO_CONTENT);
Any ideas on how to do it? I found something on the forum but he constantly maintend either the height or width. Thank you.
Something along the lines of:
function resize(frame, by) { frame.resize(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.TOP_LEFT_ANCHOR, ResizeMethods.MULTIPLYING_CURRENT_DIMENSIONS_BY, [by, by]); } function fitTextFrameProportionally(frame, factor) { if (frame.overflows) { while (frame.overflows) { resize(frame, 1 + factor); } } else { while (!frame.overflows) { resize(frame, 1 - factor); } resize(frame, 1 / (1 - factor)); } } fitTextFrameProportionally(myTextFrame, 0.01);
Jeff
Tags: InDesign
Similar Questions
-
How can I get rid of text "Is a placeholder for the content in the topic" production HTML5 MS?
With the help of RH11.03 - Multiscreen Layouts of HTML5 (don't know if it applies to provision adapted).
Whenever I generate help, the "' next placeholder text appears at the bottom of the theme files:
Enter the Desktop '(default) topic' file shows this placeholder text, I can delete to let the empty paragraph tags. However, whenever I have save/generate the file, the text is displayed again (and so there are several paragraphs of placeholder).
How can I remove this text. I have opened the Layout.CSS file and see the following for the "contenttopic" div class and the wTopic widget, but I have no idea how it generates the placeholder text:
You could do all of the light would be appreciated.
Thank you
George
Let the widget.xml in the State. If you change this one, your output may break!
If you open Topic.slp, remove the '
This is a placeholder for the content in the topic.
'. The editor of RoboHelp adds text to placeholder alone.You can also use the HTML HR display to remove this code. If you close the Topic.slp WITHOUT going first in design, HR should not add the code.
-
Hello assistants scripts! I hope one of you can help me in this simple task. How I wish that the acts were an option! I read the messages saying how from simple scripts to apple is. I have read the tutorial from start to finish and doing the exercises. I have copied excerpts from multiple sources, and the only thing I could do is to insert the content... but not proportionally.
I use INDD CC. I have a dozen pages in tabloid format with a hundred images illustrator on each square. Here's what I have to do for everyone from graphic images:
1. that all graphic frames the same size: 10 x 10 mm
2. Insert the content to frame proportionally
3 Center in the framework
Can anyone help? Thank you!
Hey Kevin,
These dang millimeters! The script that I came by default to pixels of all things. So my solution (actually two scripts) isn't pretty, but it works but he paints with a broad brush... each rectangle. I hope to add a line repeat like yours, so I can see what I want. A blogger out there in the Land of script sent me a few ideas on how to combine and improve them; I hope soon to sink into their logic. These are the two that I came up with:
Resize the frame 10 x 10 mm
say application "Adobe InDesign CC 2014"
activate
say an active document
Resize each Rectangle in internal coordinates anchor of Center of replacement of the current dimensions with values {30, 30}
end say
end say
Insert the picture content (proportionally, centered)
say application "Adobe InDesign CC 2014"
activate
say the active document
say each Rectangle
fit content to frame
adapt given proportionally
adapt content Center
end say
end say
end say
-
I'm filling out a form that is available on a site. When I click on the option to fill out and submit the form 'online' a pdf document is displayed in chrome with the following text
«To display all of the content of this document, you need a later version the viewer PDF.» You can upgrade to the latest version of Adobe Reader from www.adobe.com/products/acrobat/readstep2.html for further support, go to www.adobe.com/support/products/acrreader.html"
Needless to day, I installed the latest version. I even reinstalled using the link in the message, but nothing helped. Whenever I click on the link to go forward, I get the same message. Question: (i) is it my PC/software (Vista), (ii) is the site where I'm trying to submit the form, or (iii) is it the software acrobat reader. Note that I used successfully the last version to fill out and sign forms.
It is none of them. It's Chrome, which is ignoring Adobe Reader and showing the message.
Solution: just save the document (with the message) to your desktop. Then open it in Adobe Reader. The 'real' should then display.
-
change text frame options based on the content paragraph style
Hi Experts,
Write a script to change the options of text block when this frame contains particular style (s), but I get an error message such as the object is not valid when I pass the line 12. Can someone please help me find the error?
And can some on please show me where can I find exactly what that error is on ESTK?
var mystyle=["caption"]; for(k=0;k<mystyle.length;k++) { app.findGrepPreferences = null; app.changeGrepPreferences = null; app.findGrepPreferences.appliedParagraphStyle = mystyle[k]; var fnd = app.findGrep(); for (a=0; a<fnd.length; a++) { var myTextFrame = app.selection[0].textFrames[0]; alert (myTextFrame); myTextFrame.textFramePreferences.firstBaselineOffset=FirstBaseline.ASCENT_OFFSET; myTextFrame.textFramePreferences.minimumFirstBaselineOffset=6; myTextFrame.fit(FitOptions.FRAME_TO_CONTENT); } app.findGrepPreferences = null; app.changeGrepPreferences = null; }
something along this... not tested
var styleNames = ["caption"]; table to fill
var doc = app.activeDocument;
for (variety p = 0; p)< stylenames.length;="">
{
app.findGrepPreferences = null;
app.changeGrepPreferences = null;
app.findGrepPreferences.appliedParagraphStyle = doc.paragraphStyles.itemByName (styleNames [p]);
find var = app.findGrep ();
If (find.length > 0) setTFProps (find);
}
function setTFProps (find)
{
for (var i = 0; i)< find.length;="">
{
var parentTextframe = find[i].parentTextFrames[0];//assuming only textFrame by legend
with (parentTextframe)
{
textFramePreferences.firstBaselineOffset = FirstBaseline.ASCENT_OFFSET;
}
pT.fit (FitOptions.FRAME_TO_CONTENT);
}
}
app.findGrepPreferences = null;
app.changeGrepPreferences = null;
-
How to read a text file and then view the content as a string
I also want to strip the string from a certain substring, and convert the string into an array of floating-point numbers. I thought the use of playback of the worksheet vi, but I not know exactly if it will work. Any help would be greatly appreciated.
It is here that 8.6. All you had to do was wire the 'chain after' the chain of worksheet to the table.
-
the program continues to block the content even with blocking function disabled. I constantly switch between browsers due to the annoying feature. I want it to stop blocking content, I want to disable the blocking, but laboriously must stop at all the sites I visit and spend time while it blocks content, demand if I want to keep the content blocking, annoyingly sinks and I must say to "remember" not to do and does it continuously , while continually annoyingly content blocks! I want him to stop doing that. I'm an adult, I'm 60 years old. I don't need a babysitter on my browser telling me what I should see and what I see, please fix this as soon as possible. Apparently disable the pop-up blocker does nothing to stop this annoying problem. Its design and its content filtering. It's illegal I think since my content I pay and I pay view all content on the world wide web. I want to stop my research of filtering and blocking content! ENOUGH!
You have an extension, the FindWide toolbar, which many view as an unwanted intruder. You should be able to disable or remove the page modules. Either:
- CTRL + SHIFT + a
- "3-bar" menu button (or tools) > Add-ons
In the left column, click Extensions.
For completeness, here's my method to track down and clean up bad Add - ons and other ad injectors. I know it seems long, but it's not so bad.
(1) open the Control Panel, uninstall a program. After the loading of the list, click on the column heading "installed on" to group infections, I mean additions by date. This can help the undisclosed items bundle smoker who snuck out with some software, you have agreed to install. Beware of everything that you don't recognize / remember, since malware often uses sounding names important or innocent to discourage you remove. Out as much garbage as possible here.
(2) open Firefox page modules using either:
- CTRL + SHIFT + a
- "3-bar" menu button (or tools) > Add-ons
- in the Windows "Run" dialog box, type or paste
firefox.exe "about:addons"
In the left column, click on Plugins. Set essential and unrecognized plugins 'never enable '.
In the left column, click Extensions. Then, in case of doubt, disable (or delete, if possible) not recognized and unwanted extensions.
Often, a link will appear above at least an extension disabled to restart Firefox. You can complete your work on the tab and click one of the links in the last step.
Any improvement?
(3) you can search the rest of problems with scanning/cleaning tools listed in our technical support article: Troubleshooting Firefox problems caused by malware. These scanners on request are free and take a long time to run. If they end quickly, especially if they require the payment you have a serious infection. I suggest the specialty forums listed in the article in this case.
Success?
-
I am newbie in indesign scripting of animals. So I apologize because I couldn't post my essays.
Objective:
I have a .indd document which will be a figure of legend, label etc. I need to copy the content (a figure that is editable) else file indd of this document where the tag figure exists.For example:
Sample.inddSome text Fig.1.1 caption some text
I need to copy the contents of figure1.indd and paste in the document sample.indd where
Fig.1.1
string exist and so forth. Now I do it manually. But am supposed to automate this process.So, I need some hint how to do it using extendscript?
I found something like below, to do so, but I have no idea to develop it further and also do not know if this approach is correct my results. Please help me
myDocument=app.open(File("file.indd"),false); //opening a file to get the content without showing.
myDocument.pages.item(0).textFrames.item(0).contents="some text"; //here I could set the content but I don't knw how to get the content
// ?????? Then I have to paste the content into active document.
Try this test nicely to your and end, hope this will help you.
var myDoc = File("/D/Sample.indd");//Figure File var myFigDoc = File("/D/Figure.indd");//Destination File app.open(File(myFigDoc)); app.activeDocument.pageItems.everyItem().select(); myObj = app.selection; var myGroup = app.activeWindow.activePage.groups.add(myObj);//Grouping the objects myGroup.select(); app.copy(); app.open(File(myDoc)); app.findGrepPreferences = app.changeGrepPreferences = null; app.findGrepPreferences.findWhat = "Fig 1.1";//Figure caption text app.findGrepPreferences.appliedParagraphStyle = "FigureCaption";//Figure Caption Style myFinds = app.activeDocument.findGrep(); for(var i=0;i
-
collect the contents of the specified text blocks (CS3 JS)
Hello - I have what I hope, it's a very basic question:
I have the following code snippet:
var doc = app.activeDocument;
for (var i = 0; i < doc.textFrames.length; i ++) {}
myF var = doc.textFrames [i];
If {(myF.strokeWeight == 1)
var myText = myF.contents;Alert (MyText);
}}When I run the present, I get the correct results, but in two alert boxes different. What I have to do is collect all the results in a single string. Do I need another loop to collect the contents into a string?
Any help would be greatly appreciated.
Thank you
Hey!
Well, put you alert inside the loop, so you'll be alerted for each block of text with good conditions. I think this would work better:
var doc = app.activeDocument; var myText = []; for (var i = 0; i < doc.textFrames.length; i++) { var myF = doc.textFrames[i]; if (myF.strokeWeight == 1) { myText.push(myF.contents); } } alert(myText.join("\r"));
It will create the table and push the content all found in and at the end, it will display the results.
Hope that helps.
--
tomaxxi
-
AS / CS4 sets the content of the block of text by label
Hi, how can I set the contents of a block of text, select it by label?
I wrote inside a tell statement:
the value content of block text whose label is "label4" to 'test '.
but it does not work
Help, please
Thank you
Use:
the value content of the text block 1 with the label "label4" to "test test".
-
Page background to adapt to the content of the page.
Hello!
I would like to know how it is possible to make the background of page resize based on its contents. Here is an example of what I'm trying to achieve:
Thank you! I really appreciate your help.
(A) open the "rectangle in master" layout page, place a block of text above, start a preview of the browser and minimize the browser window. All work as expected.
It is best to place the rectangle on the page layout (instead of the master page), because if you resize items that should remain in the bounding box, or if you add items, you must resize the bounding box in page view.
The dynamic adaptation of the size goes on your finished page or in preview mode.
(B) another way to reach a height of actual dynamic page:
Open your setting in page (and not his mistress), open the "Page/Page Properties" menu and uncheck the option "Sticky Footer". In this case, the page height is not determined by the height of the browser window, but by the content of the page. In other words: move or items down will push the bottom of the page down as well (that long these element are not specified as "Footer" elements).
-
How to pass the content of an xml element in the text frame in inDesign Script
var XMLFile = File.openDialog ("select XML Files... ») ;
var doc = app.activeDocument;
If (!) App.Documents.Length)
{alert ("ERROR: Document not opened");}
return;
}
doc.importXML (XMLFile);
var firstFigureNode = doc.xmlElements [0] .xmlElements [1] .xmlElements [0];
var lableNode = firstFigureNode.xmlElements [0];
var lableNodeText = lableNode.contents;
myFrame var = doc.textFrames.add ({geometricBounds: [-13, 13, 3, -3]});
lableNodeText.move (LocationOptions.AFTER, myFrame.texts [0]);
========================================================
My requirement is: == > > move the content of an xml element in the text by inDesign Script block, but XML InDesign file Structure should not be change & data in the XML Structure should remain as it was before...
I tried to code above, but it does not work...
Please can someone help me in solving this problem...
It does not work correctly...
It moves firstFigureNode in myFrame...
firstFigureNode.placeXML (myFrame);
===>> For Apple Script try below Code ===>>
myFrame markup using firstFigureNode
-
Extract the contents of the text box
Hello
I am trying to automate a process PDFing complex. A single indesign document should appear as several PDFs named, which fall into a number of folders that also have specific names. If I place the PDF names and folders in text boxes on the pasteboard of indesign pages they can be recovered by a script. Do I need to mark the text box, so the script knows where to look, and how this is done?
Thanks much for any help.
Hello
Create a new layer and name it as "printpdf", create a block of text with this layer on each page and fill in the content, as shown in the picture, the first line for the name of the folder and the second row for filaname. The text block should be placed within the page, not the editing table.
var doc = app.activeDocument; var pages = doc.pages; var _layer = doc.layers.item("printpdf"); _layer.printable = false; for(var i =0;i
Kind regards
Cognet
-
Yet once, now that Adobe's Flash problems are everywhere the news what are my options to display the content on the sites that were previously used by Adobe Flash? I uninstalled Adobe Flash, but need an alternative. Thank you!!!
Mozilla had 'soft-blocked' version 18.0.0.203 and earlier, which still allowed you will activate Flash on websites of that trust.
If you are not accustomed to using the "Request to activate" feature with any of your plugins, here's what to expect:
When you visit a site that wants to use the Flash, you should see a notification in the address bar icon and one of the following: a link in a black rectangle in the page or an information bar slides between the toolbar and in the page area.
If you see a good reason to use Flash, and the site looks trustworthy, you can go ahead and click on the Lego-like icon in the address bar to allow Flash.
But some pages use Flash only for tracking or play ads, so if you do not see an immediate need for Flash, feel free to ignore the notification. It will just sit there in case you later want.
Until this ordeal of previously unknown security flaws shakes, you might want to try this and see how it fits. To set the Flash "Ask to activate", after you have reinstalled it, open the page modules using either:
- CTRL + SHIFT + a
- "3-bar" menu button (or tools) > Add-ons
In the left column, click on Plugins. Search 'Shockwave Flash' and always change 'enable' to 'ask to activate '.
-
Until about 3 weeks ago, I saw the site of the New York Times a day with no content blocked by the Firefox browser. With recent updates in Firefox, the NYTimes site appears in a default form blocked, whenever I go to him. So, I have to manually disable the blocker mixed content Firefox to view the site Web of the NYTimes in the normal display mode. My only other option, right now, is to use a different browser (IE or Chrome), I want to do. Ask for help turn off the blocker of home for individual Web sites. Thank you.
It is not possible.
You can watch this extension:
Maybe you are looking for
-
Unable to connect to a filtration gmail account
TBird has worked well with my standard Gmail account. Today he keeps asking my gmail password when connecting. Address, email and password are filled correctly, he continues to ask for a new password. What's not here?
-
Hi, have a bad rtc battery! tried to reload, however, does not always cmos! can I change myself and it's the same type of battery in a computer at home Thank you
-
Touchpad stopped working on my new C850 Satellite
I have new Toshiba Satellite C850-B293 after a day can touch pad didn't work.Can someone help me? I already check the setting and I put in default, but still changes now. Please help me...
-
C5180 all in one: photosmartessential
Try to sue HP Photosmart Essential - used to work. Now it says cannot find the HPPhotosmartessential.msi. I can't find my original installation disk, if anyone can help?
-
Vista - Photo Gallery Tried to upload a .jpg from an SD card image (the image was scanned with a Pandigital Photo converter, slide, negative (model # 05 PANSCN).) This message appeared in the photo gallery, "Photo Gallery can't open this photo or vid