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.

Script to Print the Contents of a Container

Featured Replies

Hello,

I created a button below an object (a PDF file) in a container that says "print". Upon clicking it, I would like it to run a script to open the PDF file in that container, print it, and then close the PDF file. Any thoughts?

Greg

You can use the Send Event Script step with a batch file (say oppdf.bat) with the line

start %1

The script step would have oppdf.bat & " " & the_container_field.pdf. Trying to print this directly--not sure how--don't see any comman line options or any way to pipe it.

  • Author

Thanks, but I think that's a bit over my head. I've never created a batch file before (I know what you're talking about though) and wouldn't I have to create one for EACH file? I guess the users will just have to learn how to double click on the object and print. I was just trying to save a few steps.... by making things newbie proof.

Greg

Just one batch file. The %1 is a batch parameter--the actual file name.pdf will instantiate it.

  • 7 months later...
  • Author

Hello,

Now, months later I've been looking at the Send Event script step. If you use Send Event, select the file option, and feed it a file address it will open the PDF and print it; however, I would prefer to use a calculation to get the file name and print it that way. Can this be done without a batch script as you talked about previously? I have no experience creating batch files.

Greg

Set up a calc field that equals the container field and have the type set to text this will give you the file name and location if a referenced doc. when you set up your send event script rather than have it open file choose print from drop down menu.

select calculation rather than file in the radio button and select the new field as the calc.

now when you run script it will print the document with an option of having file opened in background

Edited by Guest

  • Author

Thanks,

That works for me except the space issue. I'll just avoid naming with spaces.

Greg

  • Author

For those of you struggling with the file name spacing issue... try using Quote (fieldTO::textfieldname) as the calculation in SendEvent. It worked for me!

Greg

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.