4everJang
Advocate
4everJang
Advocate
Activity
‎Sep 23, 2024
04:28 AM
I fully agree. It would have made more sense to drop the FDK, as programming clients in Visual Studio C++ brings the hassle of having to recompile for every FM version - and using specific VS versions to do so. Scripts, once they work and not rely on outdated FM features, will continue to work without any need for recompilation. And Adobe has issued the Visual Studio Code plug-in for ExtendScript, which is a step down from ESTK but does mean the scripting option still exists going forward.
... View more
‎Sep 22, 2024
11:37 PM
I might file a bug report. To be honest, I have not yet checked the latest update to see if scripting is supported now. It seems obvious that it should be, as a number of plug-ins will depend on it. I told the tech team about my scripting requirement but the only answer I received a while ago is that it was not supported in that particular beta. Have not heard back since, so I am assuming it is not available in the update either. And as I have moved away from coding for a long while I have not yet taken the time to check things out since that beta.
... View more
‎Sep 22, 2024
11:19 PM
I have not tried Update 4 yet as I have moved to a new Mac and FrameMaker for ARM-based hardware (via Virtual PC layer) does not support scripting. Which means I am moving away from FM as I refuse to be forced to get a native Windows machine. Not sure why FM has been made available for ARM-based Windows at all if scripting is not included.
... View more
‎Dec 07, 2023
06:14 AM
1 Upvote
Hi Rick, That works. Thanks. In the meantime I had also found another method. Not using the oPgf.Tabs property but going through GetProps method to assign the tsval to oaTabs. With that method, oaTabs seems to be the pointer to the right tsval structure in oaProps that I needed. Here is the working code: var oaProps = oPgf.GetProps( );
var p = GetPropIndex( oaProps, Constants.FP_Tabs );
var oaTabs = oaProps[p].propVal.tsval;
var oaNewTabs = [];
for( n = 0; n < oaTabs.length; n++ )
if( oaTabs[n].x < iLeft + 10 || oaTabs[n].x > iRight - 10 )
oaNewTabs.push( oaTabs[n] );
while( oaTabs.length ) oaTabs.pop( );
for( n = 0; n < oaNewTabs.length; n++ ) oaTabs.push( oaNewTabs[n] );
oPgf.SetProps( oaProps ); The script is kicking out the tabs at positions between iLeft and iRight (which are calculated from the label text, which might be shorter or longer depending on content and language). Kind regards 4everJang
... View more
‎Dec 07, 2023
12:37 AM
1 Upvote
I need to change the tabs in a paragraph via scripting. Here is what I have so far: var oaTabs = oPgf.Tabs;
var oaNewTabs = [];
for( n = 0; n < oaTabs.length; n++ )
{
if( oaTabs[n].x < iLeft || oaTabs[n].x > iRight )
oaNewTabs.push( oaTabs[n] );
}
var oaProps = oPgf.GetProps( );
var i = GetPropIndex( oaProps, Constants.FP_Tabs );
oaProps[i].propVal.tsval = oaNewTabs;
oPgf.SetProps( oaProps ); Replacing the tsval inside the propVal for the paragaph tags does not work. I believe tsval is an alias to an array that is actually there, but what is the property name of the array that I need to replace ? Can this be done at all in this manner ? Thanks for a quick reply
... View more
‎Dec 01, 2023
01:52 AM
Thanks, but that page does not say anything about non-breaking whitespace. I did find out that FM keeps the non-breaking spaces, though.
... View more
‎Nov 30, 2023
07:56 AM
1 Upvote
Hi Rick, I am using FM 17 (i.e. 2022). I believe it was a false alarm. I created a bunch of non-breaking spaces in an XML and saved it, then opened in oXygen. It looks like a regular space but in reality it seems to be a non-breaking one. I was expecting the &#A0; code to appear in the XML in oXygen, but apparently oXygen automatically renders it as a space. I will run some more tests to see if the hex code in the XML is correctly translated to a non-breaking space in FM and then kept when round-tripping. Thanks.
... View more
‎Nov 30, 2023
07:44 AM
I have a deadline coming up and run into a problem with FrameMaker when saving to XML. Non-breaking spaces - which are put into the XML before opening the file, using the   character code - are handled correctly when reading the XML file into Frame, but when I save the XML, all of those spaces are replaced with simple (breakable) spaces. Not what would be expected. Looking for a global setting or an entry in the read-write rules to keep Frame from corrupting my XML. Any pointers are welcome, as long as I get them asap. Thanks
... View more
‎Sep 14, 2023
08:38 AM
I am working on a large XML application and now need to use inclusions (referenced files). All files are in a custom XML format. I know FM can handle these types of inclusions as they do work for DITA content, but I cannot figure out the read-write rules I need to make it work on my custom XML. It looks like the dita_fm client does all kinds of things while importing and exporting, but that is not documented anywhere. I can create a script that pulls the included files in after opening the main document, but when I write the main document to XML I do not want FM to push all the content of the included files into the main XML. I tried using a rule (which is described in the read-write rules reference) 'writer drop content' but that rule seems to make no impression at all. Anyone has experience with custom XML inclusions ?
... View more
‎Sep 11, 2023
12:25 PM
1 Upvote
All of my code - Extendscript binaries, support files, XSL, etc are always placed in the user's AppData space. The main reason is that I have very quickly become bored with paranoid IT staff when asked to install some very useful timesaving scripts for their documentation people. That simply never worked. The user's AppData space belongs to the user and with today's enormous hard drives there is not really a valid reason not to replicate the code into each user's AppData space - as long as your code contains a command that allows easy updating from some network location.
... View more
‎Aug 25, 2023
10:56 PM
Well, as long as it turns out to be only a man-eating lion, she should have nothing to fear...
... View more
‎May 21, 2023
01:54 PM
1 Upvote
Not sure if the Print to PDF option is available to ExtendScript. That would be a requirement for my project.
... View more
‎May 17, 2023
07:55 AM
Not sure if all the PDF creation methods are ultimately using the same code, but I do know that calling the SaveAs method for a Doc object from scripting is extremely slow. I need the fastest PDF creation method that FrameMaker has to offer, but it should be possible to call it from ExtendScript. Any suggestions are welcome. And I am sure others will be happy with some positive answers, too.
... View more
‎May 02, 2023
11:52 AM
I am not using Distiller. I don't think it is installed on my system, and I cannot even find any joboptions file. But maybe it is hidden in one of the 100 subfolders of FrameMaker. I sent a question to the Adobe dev team asking where this property can be set when using the SaveFmtPdf. I will post an answer here when I get it - or when I have figured it out.
... View more
‎Apr 27, 2023
03:04 AM
I have a script that saves my files to PDF, using the following lines: var oaParams = GetSaveDefaultParams( );
i = GetPropIndex( oaParams, Constants.FS_FileType );
oaParams[i].propVal.ival = Constants.FV_SaveFmtPdf;
i = GetPropIndex( oaParams, Constants.FS_PDFUseDistiller );
oaParams[i].propVal.ival = 0; My customer now asks me to generate PDF 1.7 instead of the current 1.6. Does anyone know where I can set this property ?
... View more
‎Apr 17, 2023
07:22 AM
1 Upvote
Can you share a (possibly fictitious) extract of such a LOEP that shows how and where the page numbers appear ? That makes a big difference in the possible solutions.
... View more
‎Apr 14, 2023
12:38 AM
What exactly are you trying to achieve? Do you need to have the background texts included in your LOP and where should they appear in the list? There are ways to make the FM process do what you need it to do but it sometimes requires a different approach to the original problem.
... View more
‎Apr 12, 2023
09:38 AM
Never use copy-in, always reference. For photos use JPEG, for bitmap-types use PNG, for drawings use SVG.
... View more
‎Apr 11, 2023
05:57 AM
Tried it and it works. Thanks. If only all tricks were this easy 🙂
... View more
‎Apr 11, 2023
05:49 AM
Doesn't that mess with the current lowest object on the page ? Or does Fm automatically adjust the current lowest one ?
... View more
‎Apr 11, 2023
05:24 AM
Dear fellow FrameMaker scripting geeks, I am creating graphic objects (rectangles) in FrameMaker to make the content look 'boxed' without having to revert to 1-cell tables. My script is creating rectangles on the page with the right location and dimensions to make the content look boxed. So far, so good. But when I have a filled box, I need to push it to the back after creating it. And although I can do this for a single box using the Fcode for the GraphicsSendToBack command, this turns out to be very unreliable when I have a number of boxes in the same document. Does anyone know an alternative method to make the new rectangles move to the back of the page so that the actual content becomes visible again after creating the boxes ? Many thanks for any ideas you might have. Jang
... View more
‎Apr 07, 2023
05:17 AM
1 Upvote
Thanks everyone. Nice to get help on various deep-technical things. As you may know, I keep pushing the boundaries of what FrameMaker can do. I am still very much covered in work but I am planning to share some of my scripting tricks when I find the time. Not here, where they will quickly be lost in all the other posts but in a dedicated corner of my Smart Information Design website, so that they remain available as sources of inspiration and reference to taming Frame.
... View more
‎Apr 06, 2023
12:36 PM
Hi Rick, Thanks for the code. I expected you would answer. I tried the code and although it works when using the '\u03C3' as a single string value, I have not been able to assemble the code from the \u prefix with a string value coming from the attribute. The attribute would show '2018' and if I literally create the string '\u2018' it works fine, but when I use the following code it does not: var sAttrValue = '2018' (this is actually read from an attribute by another function, but that would make this reply too long and hard to read. var sCharCode = '\u' + sAttrValue; Although the combined string should read '\u2018' what happens is that I get the visible text '2018' on my page. For my current project I can live with this as there are only about 10 possible attribute values (i.e. character codes) so I used a switch statement and entered the correct \u values as complete strings. But if there is another application where I would need to read any possible unicode into an extendscript I would not be able to handle it this way. So if you have another trick to make this work I would be happy about that. Jang
... View more
‎Apr 06, 2023
08:13 AM
One of my scripts requires entering a unicode character, but I have not yet found the method to do so. I need to use the oDoc.AddText method, which requests the second parameter to be a text string. I can enter a unicode character in the script, but it needs to be pulled from an attribute which carries the unicode number for the character. So how do I go from unicode number to an actual character to be pushed into my doc? Maybe this is trivial, but I am not getting any results with my trials so far. I have tried using the String.fromCharCode( ) but that results in a question mark (indicating an unknown character). Any help is greatly appreciated.
... View more
‎Feb 17, 2023
07:36 AM
1 Upvote
Wow. Totally undocumented. Thanks a bundle, Rick.
... View more
‎Feb 17, 2023
07:11 AM
Does a TextLoc have a LocY ?!!!
... View more
‎Feb 17, 2023
07:02 AM
But that gives me the object on the reference page. I was looking for the object as it appears above the paragraph that has the FrameAbove property set. More specifically, I need to know its vertical offset on the page. If there is another way to know the vertical offset of a paragraph on the page (in the text frame) that would work, too.
... View more
‎Feb 17, 2023
06:37 AM
I am inserting various frames via context rules in the EDD. I am trying to find a method to access some of the properties of frames that are automatically put on the page by FrameMaker via these formatting rules. Is there anyone who has tried (and succeeded) in doing this ? I have tried to find all graphic objects in the text frame but these auto-included frames are not there. Finding all graphic objects on the page only gives me the textframe. I have also tried to the to the frame via the properties of the paragraph for which the FrameAbove property is set, but that only gives me the name of the frame, not a handle to the frame itself. Or is that a hidden property in the propVal ? Any help would be appreciated - although I know that I am probably walking down untravelled roads again here...
... View more
‎Feb 09, 2023
12:57 AM
I have done many semi-automated conversions. I do have a conversion pipeline that uses a lot more than just the conversion table - adding lots of scripted corrections, preparations and post-processing to get the desired result. But that does not come for free as it represents years of work. Trying to do the conversion yourself without experience with the conversion table is just going to drive you crazy with the complexities you mention. If you can send me the original document I can give you a quote on what it would cost to do the conversion for you. Send a message to jang@smartinfodesign.com if you are interested.
... View more
‎Jan 24, 2023
07:06 AM
I finally found the cause of this issue. It turns out that FrameMaker bases its XML output behaviour on the definitions in the DTD that is associated with the XML document. I had the definition for xref showing PCDATA and this causes a start tag without an end tag. When I changed the DTD definition to EMPTY the tag was correctly closed. You could state that this is what is written in the Structured Application Developer's Guide, but in my honest opinion this is very strange behaviour and does not seem to serve any realistic purpose. Why not simply give an error that the DTD has an invalid type definition for the cross-reference element, or even better - simply write the closing tag no matter what that definition is. Generating invalid XML without even so much as a warning is a serious bug if you ask me. But I am happy that I finally found out about this crazy behaviour so that my project is saved from going under. Not happy about the amount of time it took to figure this one out, though.
... View more