Jump 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.

Shell Scripts for Dummies

Featured Replies

Hi

This all started a week or so ago when I was reading the "Appending to PDF from Container Field" on a Tech Talk thread and a client asked about something that resonated with that thread.

The client has a db table with a container field that references a number of promotional/training PDFs on their server.

They would like to eMail from Filemaker (v10 on Macs) to a client and attach a single PDF file that contains merged/appended PDFs that they feel would be useful for the client.

We can get all the PDF names into a simple portal. They can then check off the PDFs that they require. With 20 or more PDF choices there are a lot of possibilities.

We can then search for the requested PDFs (unchecking when found) and do a loop to export field contents to the temp directory. The PDFs are named PDF1, PDF2 etc.

We can then to a SaveAsPDF to create a cover page with client info and a list of the "attached" PDFs - actually merged/appended - name is "Cover.pdf".

So now we have everything that now they require merging.

This little utility does that JoinPDF - http://freshmeat.net/projects/joinpdf/

It requires an OS install but does as advertised.

This command in Terminal:

joinPDF /Users/stephen/Desktop/PDF_Follies/joined.pdf /Users/stephen/Desktop/PDF_Follies/PDF_Five.pdf /Users/stephen/Desktop/PDF_Follies/PDF_Four.pdf /Users/stephen/Desktop/PDF_Follies/PDF_One.pdf

will merge, in order, PDF_Five then PDF_Four then PDF_One into Joined.pdf. Great.

I found how to save this as shell script and can even run it in Terminal. And it works.

This is where the trouble starts.

1. I would like to execute the shell script from Filemaker.

2. I would like to be able to dynamically build the code in Filemaker and then have it run in the shell.

3. My Unix skills barely extend past "ls -l", actually they don't go past.

360Works Scriptmaster runs shell scripts but I am absolutely clueless as to how to even starting to consider going about that. I have acquired "Take Control of the Mac Command Line with Terminal (1.0.2)" and Apple's "ShellScripting" but both books seem to assume that I am keen to relinquish my mouse for the joy of incessant typing. And that I really want to take control of the command line. I don't at all want control of the command line at all - I'd just like it to do me a small favour.

So I think my question then becomes this.

Can I dynamically build a shell script that I can execute in Scriptmaster? And if so, how do I make this work in FMP?

Stephen

  • 3 weeks later...

Sorry if my answer is too simplistic.

But you would concatenate your shell commands in a text field and then pass that value to SM's runShellScript module as a parameter.

Please feel free to call or post here with more questions.

Create an account or sign in to comment

Important Information

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

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.