Is there a way to obtain file extensions through Workflow running a script for documents within Laserfiche. If so could anyone help out with this?
Is there a way to obtain file extensions through Workflow running a script for documents within Laserfiche. If so could anyone help out with this?
That should be fine. Are you running Find Entry just to get the entry's extension? If that's the case, you could just get rid of the Find Entry activity and wrap your script in a Conditional Sequence with a condition of the entry's extension. WF will handle getting the extension for you.
I'm not sure of the exact extent of what you're trying to accomplish, but as of Workflow 9.1 the ability has been added to retrieve various document properties (including document extension) without the need for scripting.
From a Find Entry, Find Entries, or Search Repository activity, click on the Additional Properties pane to bring up the following menu.
This will allow you to select various properties to return as tokens when finding documents.
What I have going on right now is I have a sdk script that generates pages. I want it to only run for PDF file types since there are issues with Microsoft documents. I want it to be for the entire repository as well hence why I want to check for the file extension. So since this will be on the fly I would need to check the files extension within the script.
To check the type of the e-doc in an SDK script, use the DocumentInfo's MimeType property. For PDF documents, the MIME type should be "application/pdf".
So if I were to mix what Aaron stated with what you stated Matthew would that work in comparing the file extension. Would I then do:
if(GetTokenValue("FindEntry_OutputEntry_MIMEType")=="application/pdf")
I'm not sure if the syntax is correct or not.
That should be fine. Are you running Find Entry just to get the entry's extension? If that's the case, you could just get rid of the Find Entry activity and wrap your script in a Conditional Sequence with a condition of the entry's extension. WF will handle getting the extension for you.