Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Seamlessly open file in Container

Featured Replies

Hi all,

My first request for help would be to see if it was possible to script the opening of a file contained in a container without having to first save the file, but I am now starting to believe that this is impossible and the file must be saved locally first.

So my next question. I can setup the script to export the field contents - I do not want the user to see the save as dialog box or even know they are saving the document, i want them to click a button and the file opens seamlessly.

So, in the script I set the file path to c:/windows/temp/ (this solution will only ever be used on PCs) and I set to automatcially open the file after saving.

But i will not know what the file type is so I cannot specify to save it as temp1.xls or temp1.pdf etc

Is there anyway I can set the file path to C:/Windows:/temp/ ?? I could use getastext getfiled.... and so on but I do not see a way of using a calc to specify the save as filename?

If someone could in fact tell me an easier way of setting a script to open the file from the container regardless of file type withou any user interactiona at all I would be extremely grateful.

Many thanks

Ed

You are correct - in order to open a file that is embedded in a container field, you must export it first.

I do not see a way of using a calc to specify the save as filename?

You do this by defining a script variable as the destination path, then using it in the export, for example:

Set Variable [ $path ; Get (TemporaryPath) & GetAsText ( Table::ContainerField ) ]

Export Field Contents [ Table::ContainerField ; $path ; Automatically open ]

  • Author

Thanks Comment - looks like it should work perfectly, but am coming accross a small issue.

The variable idea works great but the temp path is what I am having a problem with

If I use Get(TemporaryPath)& GetAsText(Table::Field) I receive an error when trying to open the file...

"Test.pdf" could not be created on this disk. Use a different name, make more room on the disk, unlock it or use a different disk

I created a temporary field and set this to Get(TemporaryPath) to see where it was going...

/C:/Windows/Temp/S13/

Now I am not sure how Get(TemporaryPath) works but the folder S13 does not exist in the Temp directory on my PC. I even tried creating this folder and running it again but still the same error.

I have full admin rights to the PC.

On the upside, if I set the Path to export to filewin:/C:/Windows/Temp/$Path it works great so thanks for that but I would like to use your suggestion using the Get(TemporaryPath) - didn't know this existed - as this will work on any terminal regardless, but I am having the issue.

Any ideas how to solve the error message please?

Again, many thanks for your help, this is working great but if I could use the Get function it would be even better!

Ed

  • Author

Having read a few other posts on this eror message I have got it working by adding the filewin: to the path so...

Set Variable [$path; Value:"filewin:" & Get (temporaryPath) & GetAsText (table::field)]

Works great now, slight shame because now doesn't work on macs but it never will be used on macs so not an issue for now!

Thanks again

Ed

If you just use "file:" instead of "filewin:" I believe it'll work cross-platform.

Or, you could use Get (SystemPlatform) to intelligently create the path.

  • Author

Perfect. Thanks for your help all

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.