Where to place menu for both book and doc?
Dear all, The script I'm developing creates a menu for the various steps to be taken by the user. It acts both on a single document or on a book (all of it's documents). Adding the custom menu to the...
View ArticleRe: Where to place menu for both book and doc?
Hello Klaus, AFAIK, you need to define two menus, or submenus. They can have the same commands added to them, but must be two separate items, which you can then add to the respective menus. All menus...
View ArticleRe: Where to place menu for both book and doc?
Thanks Jang - in the meantime I had a similar idea, noting that in the menu.cfg files there both a FormatMenu and a BookFormatMenu exists. But even this does not help: var menuLocation =...
View ArticleReplacing all text in book with sample text
Hello fellows, Is there a way to replace all the textual content in a book with some sample text using Extendscript? If yes, could you please point me to the relevant APIs? Thank you for your help in...
View ArticleRe: Replacing all text in book with sample text
Of course this is possible, but it might get very tricky depending on the structure of the document you want to process and on the type of sample text you want to replace the content with. If the...
View ArticleRe: Manipulating the clipboard
Klaus, If I understand it correctly, you want to put a citation from the clipboard into your FM document by pasting, but the pasted text should have double angle brackets around it to make it show up...
View ArticleRe: Replacing all text in book with sample text
Hi Jang, I appreciate your response and detailed explanations! I changed my mind - I would not replace the content with some bogus text as it may also change the amount of text lines present in files...
View ArticleRe: Replacing all text in book with sample text
It would still come down to walking through the entire list of paragraphs (in all flows that appear on body pages), then through all table cells and also through any text appearing in anchored frames,...
View ArticleRe: Replacing all text in book with sample text
Just a caution: replacing every character with an "x" could definitely change the text flow. Here is the sentence above with each non-space character changed to an "x": xxxx x xxxxxxxx xxxxxxxxx xxxxx...
View ArticleRe: Replacing all text in book with sample text
Jang, Rick,Hi! First of all, thank you guys for your responses. I appreciate that much! I wonder if it is possible to obfuscate the content without changing the file size/number of chars on a page....
View ArticleRe: Replacing all text in book with sample text
Yes, the point that Rick was making crossed my mind, too. Using regular expressions, you can easily specify which characters should be replaced. Listing a number of same-width characters and replacing...
View ArticleRe: Replacing all text in book with sample text
Hi Jang, Thanks again for your response! It definitely sheds light on the direction I should look into more. As you said, the main challenge here is to replace the text without touching table anchors,...
View ArticleRe: Replacing all text in book with sample text
Hi Jang, As part of playing with the code, I came up with the following code (took bits and pieces from various posts here on the forum). I saved it as a JSX file and ran in FM - no change whatsoever -...
View ArticleRe: Replacing all text in book with sample text
OK, I have figured it out. Here is a script that works across all text in the main flow after opening the document. var oDoc = app.ActiveDoc;var oRange = oDoc.TextSelection;var oPgf =...
View ArticleRe: Replacing all text in book with sample text
Hi, Your script handles the text items that are retrieved from the document, not the document itself. The test strings returned by GetText are copies of whatever is in the document. So you have to get...
View ArticleRe: Replacing all text in book with sample text
Hello again, I used the script on another document and Frame crashed. Use the script with care. I guess the text selection is not exactly right or the end of the loop is a little buggy. But the main...
View ArticleRe: Replacing all text in book with sample text
Hi Jang, Thank you very much for your great script and for your willingness to help newbies like me! You are a real professional! Your script is impressive! It managed to replace 99.9% of the content...
View ArticleRe: Replacing all text in book with sample text
The Undo is a matter of Revert to Saved. I don't think any other method would be feasible, as you really want to replace almost ALL the text in a file. In the meantime I have experimented on a couple...
View ArticleRe: Replacing all text in book with sample text
Hi Jang, Thank you very much for your prompt response!!! I tested the script on a sample book, so no worries. I am using FMv10. It crashed on me several times while running the script. Could you please...
View ArticleRe: Replacing all text in book with sample text
Hi Jang, I hope you are doing well! I am trying to understand how the script works and it is not clear to me what "oTexts[i].offset;" does. Could you please explain this? In the meantime, I continued...
View Article