Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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


This topic is 3729 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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!

Posted

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

Posted

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

Posted

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.

Posted

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!

Posted

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

This topic is 3729 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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