Copy link to clipboard
Copied
Hi All,
Requesting a solution for a query that has been discussed earlier, but I am not able to fully understand the replies.
I have a book in FM 2019 with around 100 documents. Each document has a table, whose Table Title should be the same as the Document Title.
Thanks in advance for your help.
Regards
Apurva
A filename extension (.fm, .book) is not strictly necessary. If your document file, for example, is just named "sample", you can right-click open it in FM, and the system variable Filename (Short) will render as "sample". If you insist on having a file to work with that has the .fm extension, I tested this with FM2019 & Win7/64p:
In Windows Explorer (file manage), right-click
new » Adobe Framemaker Document
Edit default name [New Adobe FrameMaker Document.fm]
to [sample] with no extension
ignore warn
The ExtendScript Toolkit SHOULD install with FrameMaker but if it doesn't, you can download it from Adobe's website.
https://helpx.adobe.com/download-install/kb/creative-cloud-apps-download.html
Copy link to clipboard
Copied
Replying to my own question with a wish to help someone who has a similar query.
The answer probably lies in not in using Variables but inserting a Cross-Reference to a Paragraph Style that contains the <$paratext> - the document's name. Still working on a perfect solution that works for all files in the book, but the results look encouraging.
Regards,
Apurva
Copy link to clipboard
Copied
I think a cross-reference is the solution. The other option is to create a user variable but if the file name changes, you will need to update the variable definition to reflect the new filename.
~Barb
Copy link to clipboard
Copied
Another hack is to have the FM document file name lack the .fm extension. You can create a shortcut (symlink) with the same name, and author via that, but the Filename (Short) variable will not have a .fm extension.
Copy link to clipboard
Copied
Hi Barb,
How do I automate the cross-reference in the Table Title field? Is there a variable/cross-reference/code that I can add in the Autonumber Paragraph>Fomat window of Table Title paragraph style that will automatically copy the document's title (without the .fm)?
Regards,
Apurva
Copy link to clipboard
Copied
Hi Apurva,
This looked like a fun challenge so I made a short video (about 10 minutes) explaining how I might do this. It requires some scripting but the script could be applied automatically by making it into a "Notification" script. The code that I demonstrated is below.
http://www.rickquatro.com/resources/FileNameInTableTitle.mp4
#target framemaker
var doc, file;
doc = app.ActiveDoc;
file = new File (doc.Name).name;
file = File.decode (file);
file = file.replace (/\.fm$/i, "");
doc.SectionNumStyle = Constants.FV_NUMSTYLE_TEXT;
doc.SectionNumText = file;
Copy link to clipboard
Copied
Hi Rick,
Thanks for explaining your solution through this great video.
How do I get the scripting tool that you are using? And my knowlege of coding is very rudimentary and I don't have any tools on computer except Notepad and Notepad++.
Regards
Apurva
Copy link to clipboard
Copied
Hi Bob,
Thanks for your reply. Request you to show implementation your solution in a step-by-step manner. I have only Framemaker 2019 on my computer, do I need to get any other utilities?
Regards
Apurva
Copy link to clipboard
Copied
The ExtendScript Toolkit SHOULD install with FrameMaker but if it doesn't, you can download it from Adobe's website.
https://helpx.adobe.com/download-install/kb/creative-cloud-apps-download.html
Copy link to clipboard
Copied
Hi Rick,
I appreciate your inputs and links. Will definitely try the scripting approach to numbering very soon.
Thanks for your help,
Regards
Apurva
Copy link to clipboard
Copied
A filename extension (.fm, .book) is not strictly necessary. If your document file, for example, is just named "sample", you can right-click open it in FM, and the system variable Filename (Short) will render as "sample". If you insist on having a file to work with that has the .fm extension, I tested this with FM2019 & Win7/64p:
In Windows Explorer (file manage), right-click
new » Adobe Framemaker Document
Edit default name [New Adobe FrameMaker Document.fm]
to [sample] with no extension
ignore warning about change file type
Notice that the directory view loses the FM icon, and file association for file "sample".
Right-click New » Shortcut
Location of item:
Browse to (in my case) {drive}:\...path...\Adobe\FrameMaker\Tests\sample
[Next]
Type a name for this {new} shortcut:
sample.fm
Notice that it also has no association (and can't be given one).
Right-click sample.fm with FM.
View » Master pages
In header text frame,
Insert » Variables » Filename (Short)
Notice that it's just "sample", with no extension.
Personally, I don't do this. I've always used a user variable to define the document name. In a prior assignment, file names were part numbers (e.g. 123-456.fm), and we wanted to show the p/n in the docs, but not the .fm extension.
For a current project (a .book), the document name, and indeed all the layouts, formats, color, conditions, etc. are actually defined in a separate file (template.fm). All the book component files are easily kept in sync by doing an import » formats from the template file.
This filename extension annoyance is likely a lingering effect of FM’s roots on Unix, which never really had a filename extension concept (relying instead on “magic numbers” for file typing). Indeed, FM didn't even have a convention for it on Windows until FM4 or so (I was using .mkr until Adobe decide to use .fm).
Copy link to clipboard
Copied
Hi Bob,
I appreciate the detailed reply to my query. Due to pressure of delivery, I copied the filename via manual cross-referencing, but definitely will try your method in the next job, due very soon. Thanks once again.
Regards
Apurva
Copy link to clipboard
Copied
Can you show the structure of a user created variable that would add the document name to the header? I tried to follow the steps above and my document has no file extension showing in Windows Explorer but does show the .fm in the header of the template I am working on.
Copy link to clipboard
Copied
I actually found an easier way fo doing this by renaming the file in the book menu of FrameMaker. When viewing the filename it shows the .fm extension. I removed. the .fm from the filename from that menu and the .fm dropped off the document name in the system variable. Thank you for the suggestions!
Copy link to clipboard
Copied
Hi Dustin,
When you did this in the book, you actually changed the file name. When you want to open this file in FrameMaker double-clicking will not work. Windows relies on this extension to select the appropriate application. You can probably still open the file from the book.
Best regards
Winfried
Copy link to clipboard
Copied
Dustin Fleming: Can you show the structure of a user created variable that would add the document name to the header?
I'm not sure which prior remark this is in response to, but strictly speaking a User Variable, of arbitrary name, would contain any arbitrary text you desired. The variable could then be inserted in a header frame on desired Master Pages, and would appear on all Body pages that map any of those MPs.
Copy link to clipboard
Copied
Hi @Dustin Fleming:
Can you show the structure of a user created variable that would add the document name to the header?
To add the filename to the running head, use the <$filename> building block as shown below.
I recognize that this post is about not showing the extension in the running head (like Bob, I prefer to show extensions). Do note that if you want to hide the extension in the running head, you will need to follow the steps that Bob laid out to rename your files.
my document has no file extension showing in Windows Explorer but does show the .fm in the header of the template I am working on.
As a default, Windows will hide extensions for known file types. And Windows will recognize the .fm if FrameMaker is installed, and therefore will hide it in Explorer unless you change this default (see link below). Just because Windows is hiding the extension does not mean that it isn't part of the file name.
https://www.howtogeek.com/205086/beginner-how-to-make-windows-show-file-extensions/
~Barb
Copy link to clipboard
Copied
Hi Dustin,
When your file names do not have an extension in Windows Explorer, then the option Hide extensions for known file types is activated. When this option is activated, your file names in Windows Explorer will also show the extensions.
FrameMaker always shows the file name extension in its filename variable.
When you want to hide the file name extension in FrameMaker, you would need an ExtendScript or FrameScript script to do this.
Best regards
Winfried