From inside a book? Sure, just right-click and Exclude it
I am asking if there is a way to open a document but have it hidden.
What is the meaning of excluding a document from a book?
Does this document has limitations?
If you exclude a document from the book it’s in, it gets skipped when any generated files (like a ToC or IX) are created. I’m not sure what you’re trying to do when you say “open a document but have it hidden” – maybe you can elaborate on what you’re trying to accomplish?
You can open it hidden with the FDK or ExtendScript, something like:
F_PropValsT openScript, *returnp = NULL;
openScript = F_ApiGetOpenDefaultParams();
sn = F_ApiGetPropIndex(&openScript, FS_MakeVisible);
openScript.val[sn].propVal.u.ival = True;
docId = F_ApiOpen("C:\\SomePath\\SomeDoc.fm", &openScript, &returnp);
You can also make a currently-open document hidden:
F_ApiSetInt(FV_SessionId, docId, FP_IsOnScreen, False);
There isn't any way to do it through the GUI.
Actually I was searching for a way to handle the temporary files that FM creates sometimes.
I want to exclude these documents when I loop through all open documents.
What I have done is the following:
1. Get all the open documents.
2. If any of these documents is hidden I ignore it and do not handle it in my application.
And because the temporary files are hidden by default I handle these also in the same way.
I couldn't find a way of handling temporary files explicitly with a nice API call.
This is the reason why I asked if it is possible to hide a document.
Yes, you can also just test whether a document is currently hidden:
if(!F_ApiGetInt(FV_SessionId, docId, FP_IsOnScreen)) ....
I noticed that my open script parameter was backwards, but you probably get the idea. Sorry, should have been:
openScript.val[sn].propVal.u.ival = False;