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.

Import folder of images, but allow user to select the folder...

Featured Replies

Hello

Newbie here. I am trying to create a remotely hosted FileMaker 11 script that has the following attributes:

 

1. Imports a folder full of image files.

2. The folder is never the same, it can be a different folder, on a different drive, etc.

3. Need to allow the user to select the folder they want.

4. Do NOT want the user to be presented with any other dialogue boxes, especially Import Field Order, or "Auto enter?" and so on.

 

I've tried and tried, but every combination of options on the Import script step, in one way or another, does not meet all four criteria listed above at the same time. I can get it to do one-or-the-other, but not all of the above at the same time.

 

How would one go about this?

 

Thanks!

I would recommend you look at ScriptMaster plugin (free) to perform this task.

 

There is much more flexibility with some of the feautres

 

however you can always require the user to move the folder in to a KNOWN location like the desktop into an "UPLOAD" folder then the script should import without user interaction - however it wouldn't be smart to prevent running it multiple times. the end user would have to mange the folder and move them when complete.

 

imports.fp7.zip

  • Author

Looks great except it also fails #2 and #3. I am wondering if it's not possible without, say, applescript.

If the folder doesn’t exist, you get a message that it doesn’t exist and then you can select the folder you want.

 

Which IS 2 and 3

I don't have access presently some code i have written for ScriptMaster - the reason why i would recommend that over applescript is that it's platform independent. 

 

The way I implemented it was this:

 

User clicks button - prompts for location of folder to import ( regardless of location)

That stores the path to the folder. 

Then a function looks at the contents ( recursively if needed ) to generate a list of files and paths to the files

Then you can loop thru this set of records and validate it to make sure that the file type meets your business criteria ( pdf or jpg )

and reject any that could already exist based on filename and path. 

Then it loops thru the final validated set and imports the file in to the container in your table.

 

On some occasions I actually have an import table as a log to log all imports and when does the last bit it will create the record in the attachment table setting the container file path and file name and other fields you need to populate. 

 

The log file in this case provided a way to collect data from the locations and do a few rounds of business logic then process the import at a later time, since its just a matter of running the import against the list of known path values.

 

I will try to see if I can grab it from my backups later and will post a sample.

  • Author

Thanks for replying, Lee and Ocean. 

Lee, that's the very first thing I thought to try. It seems like it should work, but it doesn't. At least for me. What happens is I get an error #100 on that script step, it never gives a prompt to locate the folder again. I've tried this with the [X] No Dialog both check and unchecked, to the same exact result either way.

 

Ocean, I was afraid it would go pretty much exactly how you describe. Please by all means do share if you can, any applescript etc to make it happen, would be grateful. Thanks!

  • Author

I've gone ahead and used ScriptMaster to create an example file that allows the user to select the folder of images to import. I'd still prefer to use AppleScript, but this can work for now. I've attached this example file for now in case anyone is curious.  Thanks again!

GroovyImport.fp7.zip

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.