Jump to content
Server Maintenance This Week. ×

Read folder with command Line


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

Recommended Posts

The following script works in Filemaker Pro 8

Go to Layout {"InvoiceViewer"(Invoiceviewer)}

Show All Records

Delete All Records[]

Send Event ["aevt", "odoc"; "cmd/c dir /b M:FolderfolderPDFfolder >c:outputfile.txt"]

Pause/Resume Script [Duration(seconds):5]

Import Records["outputfile.txt";Add; Windows ANSI]

Show All Records

But when I create a runtime it fails with the following message:

The file "outfile.txt" could not be found and is required to complete this operation

If I hit the OK button it allows me to select the file and the script continues.

It worked in the previous runtimes I created.

Any ideas?

Edited by Guest
Link to comment
Share on other sites

That's odd. I created the runtime on an XP computer and deployed it to a Windows 2000 computer. Works fine on the Windows 2000 computer but not on the XP computer. Got to be a system problem but what??

I know the XP system is set to do automatic updates, I wonder if that has something to do with it?

Link to comment
Share on other sites

It fails on the import step, right?

how's that file reference defined?

file:/c:/outfile.txt

Sounds like the runtime machine doesn't have enough time with the 5 seconds to finish the text file before the import script needs it. When you use the manual dialog you can see the file because the OS has now finished writing to it...

Link to comment
Share on other sites

Probably Pilot Error :)

It fails on the import step, right?

Correct

how's that file reference defined?

file:/c:/outfile.txt

For some reason i thought you had to have a file created already. So I created a file and when I selected the file I got the following listing in the File Path List:

file:.../../../../outputfile.txt

But now when I typed in the reference (as you described above): file:/c:/outputfile.txt

It works like a charm. And creates the necessary file.

Thanks Wim

Link to comment
Share on other sites

You're welcome.

The .../.../... indicates a relative path with the starting point being where the FM file is. In your case it basically says "go up 4 levels from where I am". When you move the file that is likely to break.

hard coding the location works wherever the file is.

Link to comment
Share on other sites

This topic is 6498 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.