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.

Waiting for something to happen

Featured Replies

Hi, new to this forum topic but not the site. Hope you can help.

I am building a (FileMaker) script that creates a report, prints it to a PDF (using Acrobat writer, my client is still in OS9), then calls an applescript that selects the new pdf, renames it and moves it to a folder.

This is repeated 50 times to create 50 reports.

My problem is that some of the reports take longer than others to create than others. Due to all the calculation fields, number of records in each and time to print the PDF.

Sometimes the applescript comes back with a message similar to 'untitled is not availble' can't proced'. then the whole process falls appart and things get named wrong, and files don't make it to the destination folder.

I think I can solve it by putting something in the applescript to wait, or pause untill the new PDF is created and availible. But I am a complete applescript newbie and can't get it to work. (actually I was totally floored that how easy it was to get to the point I did get to in applescript with no help!)

Here is the script that my FM script calls;

tell application "finder"

select file 'untitled'

move selection to folder 'Weekly Reports'

selct file 'untitled' of folder 'weekly reports;

set name of selection to 'report name1.pdf'

tell application 'FileMaker Pro'

activate

end tell

end tell

I would like to add a line to say, wait untill acrobat writer is done or the untitled file is created, then continue with the applescript.

Any sugesstions?

TIA

Jerry

Ah, one of the most fundamental problems with AppleScript, synchronization. Pardon me for not exactly answering your question, but my recommendation is to use the Troi File plug-in.

We've done a lot of moving files around. One set of scripting copies pictures files from CD's in a 9 drive tower to the local drive (50,000 images per project, 30 projects), then moves them after hours to an AppleShare server. The script has the ability to be interrupted (crash!) at any time and still recover to the point at which it left off (uses FM files on one of 5 FM servers to keep track). All this is done with Troi File (which is also cross platform).

Troi file can also find files, copy files, delete files and create thumbnail images.

-bd

  • 2 weeks later...
  • Author

After some digging and reading, I came accross the solution I was looking for. You don't need any plug ins. It isn't too hard.

All I needed was a repeat statment. (If you are gun shy, you can use repeat for 1000 times, instead of infite repeats)

The 'secret' was creating a parameter to use as a flag.

Here is the script:

repeat

try

select "Untitled"

set X_Parameter to "True"

on error

set X_Parameter to ""

end try

if X_Parameter is "True" then exit repeat

end repeat

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.