glenhest53 Posted January 23, 2006 Share Posted January 23, 2006 Hi: I am not that familiar with automation tools on Windows. So here is a brief explanation of how I automate this task on the MacIntosh. I read the contents of a folder of PDF files and then write the returned string to a text file. That file is then imported into filemaker. Here is the Applescript/Shell Command that reads the file. set theFolderList to do shell script "ls '/Volumes/main/Business/ADD/Export/'". How would I achieve the same on the Windows side. Thanks in advance Link to comment Share on other sites More sharing options...
Wim Decorte Posted January 23, 2006 Share Posted January 23, 2006 2 different methods you can use: a command line or a VBscript. A VBscript requires more code but has also more power. I've included a script below. There are however a couple of hoops you have to jump through to use the VBscript approach. Let's stick with the command line approach: cmd /c dir /b c:theFolder >c:outputfile.txt You use the Send Event script step to execute this. Anatomy: "cmd /c" calls the Windows command line interperter and tells it to quit when done with the command ("/c") "dir /b" tells Windows to produce a list of files, but just the names no other info ("/b") ">c:outputfile.text" tells Windows not to show the list on the screen but to redirect the output to a text file ------------------------------------------- Set sh = CreateObject ("Shell.Application") Set oFolder = sh.Namespace ("d:downloads") Set fso = CreateObject("Scripting.FileSystemObject") For Each filename In oFolder.Items filenamesstring = filenamesstring & "," & filename Next Set oFile = fso.CreateTextFile("c:testfile.txt", True) oFile.WriteLine(filenamesstring) oFile.Close Link to comment Share on other sites More sharing options...
glenhest53 Posted January 24, 2006 Author Share Posted January 24, 2006 Thanks Wim Link to comment Share on other sites More sharing options...
stuj1026 Posted February 1, 2006 Share Posted February 1, 2006 After you have the outputfile.txt, how would i get the contents of that file into a filed on my database. Using import creates seperate records. I would like to bring the entire dir list into 1 record in one field.. Is that possible? Thanks Stu Link to comment Share on other sites More sharing options...
Wim Decorte Posted February 2, 2006 Share Posted February 2, 2006 Yep, but it takes some wizardry : Make sure there is only one record in your found set. Import into a global, use the "update existing" option of the import. Link to comment Share on other sites More sharing options...
stuj1026 Posted February 2, 2006 Share Posted February 2, 2006 AHHH!! Very Nice Thanks for the tip Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6651 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 accountSign in
Already have an account? Sign in here.
Sign In Now