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.

Featured Replies

  • Newbies

I'm working on a project where I need to drop a text file into a folder, have it automatically save the filename, open our FileMaker 6 database on our server, find the corresponding record that matches the filename and run scripts to import that file... then move the text file to a different folder.

I'm having to accomplish this using a pc w/Windows Server 2003 SE (yuck). I'm not having trouble with the scripts in FileMaker, but I don't know where to begin to automate the folders on a pc.

Can someone send me in the right direction of the how's and what to use?

Thanks!

Welcome to the Forums, VickiH.

A couple questions to clarify:

Is the text file coming out of another application or is it dropped in by a user?

Why is the server not already open?

Are there any access/security issues that a batch file may encounter?

Is this script only to be run on Windows machines or triggered from a Mac?

What is the file name and extension?

How does the file name match the record in the database?

Import the file, import the contents of the file, or link to the file in a new location?

Please add any more details to clarify the intent of this request.

One way to do what you want is to use WinBatch which is a great automation tool. See WinBatch

It's truly a Swiss Army Knife, and is easier than writing in VB.

Steve

  • Author
  • Newbies

Thanks Mark!

In answer to your questions...

The text file will be named and dropped in by a user. That is the only human interaction wanted.

Server can already be open, but I need a script to be triggered when the file is dropped.

No access/security issues that I'm aware of.

Script will be triggered from a designated Windows machine, but databases reside on a mac server.

Filename and extension example: 13567.txt

First 5 numbers make up the single matching field in the database.

Import the file, which will create 270 records, allowing me to save the calculated results I need from those records.

Then I need the text file moved to another designated folder, which will contain all the text files once they're imported and complete. Actually, now that I think about it, as long as it can automatically save the name of the current dropped file, match and import it, they don't need to be moved.

Any help is much appreciated since I'm hoping to accomplish this by the end of this week...

  • Author
  • Newbies

Thanks Steve, I'll check out WinBatch too!

The (limited) manual process to achieve this is:

Send Message to create a text file of the folder's directory.

Pause 2-3 seconds

Import the new text file and compare the contents against the old text file records.

Isolate a new record.

Send Message to rename the file to "dir.txt."

Import "dir.txt."

Send Message to rename "dir.txt" to the original value.

Send Message to move the file to a new location, if desired.

Move and modify the data in FM as desired.

You will want two files for this. One for the directory/file handling and one for the imported data. Also, I left out the looping, pauses, and error capturing need to make this work.

To create the text file containing the directory contents.

"cmd /c dir C:Folder /b /o:n >C:Folderdir.txt

To rename the text file.

"cmd /c rename C:Folder" & record_number & ".txt C:Folderdir.txt"

To move a file.

"cmd /c move C:Folder" & record_number & ".txt C:NewFolder"

or

Use the WinBatch plug-in.

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.