Jump to content

Check for finished file?


glenhest53
 Share

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

Recommended Posts

Hi:

I have a script that reads a folder of images and then creates a text file containing the image name information. That file is then imported into a table. That table is used to create a dynamic value list that the user can select from via a drop down menu on the main table.

Question is how will the script know when the text file is finished before importing that file. The folder can contain varying amounts of images. Hence the need for a dynamic value list.

Right now I have put a pause with a duration of 4 seconds.

But depending on the anount of files the command line can take a longer or shorter duration to read the folder.

Send Event [open document/application: "cmd /c dir b/ Z: > outputfile.txt"]

Pause Resume Script [Duration (seconds):4]

Perform Script ["Import Image Info"]

Go to Layout ["MainLayout"]

Commit Records/Requests

[No dialog]

Note: Thanks to Wim Decorte for the command line script

Link to comment
Share on other sites

Or check out the VBscript plugin at http://grokittools.com. With using a VBscript and that plugin you could return the list directly back to a FM field without having to import at all. The demo file for the VBscript includes an example of just that.

Link to comment
Share on other sites

Before anyone accuses me of pushing my own products :P

A VBscript approach without the plugin would work too (but would be a lot more complex).

Your FM script would stop right after executing the VBScript, the VBscript would need to include code to call the import script (using the FM activeX interface). That would solve the timing issue.

Link to comment
Share on other sites

I am certain that the VBScript Plugin has considerably more power, and I hope to give it a try soon... but for the record, the Shell plugin will also return the text to a field without import. One consideration the user must take into account is that the return in Shell plugin is limited to 64k. I expect that is not the case with the VBScript Plug.

Link to comment
Share on other sites

This topic is 5684 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
 Share

×
×
  • Create New...

Important Information

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