Jump to content
Server Maintenance This Week. ×

List All Files in Directory


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

Recommended Posts

Hi,

I have a little problem using the "ListAllFilesInDirectory( path )" command. It does not give an (visible) result.

First I thought that it would be my lack of knowledge/installation. So I tried the "GetURLasText( url )" and followed the tutorial video step by step.
All went fine and the "GetURLasText( url )" worked great.
So now I tried the "ListAllFilesInDirectory( url )" again doing the exactly the same as I did with the URL script.
So I created a calculated field and put as calculation "ListAllFilesInDirectory( Get(DesktopPath) )" script (resulting as text) but nothing shows up.
I tried if "Get(DesktopPath)" would give an error, but that works fine.

Am I doing something wrong?

Cheers

Koen 

Link to comment
Share on other sites

you need to convert the FileMaker path that you get from the Get ( DesktopPath ) to a O/S version of the same - on Windows it has to do with the direction of slashes, on Mac something like adding the HD name

Same is true for ALL Scriptmaster functions where a path is involved as they are using Java/Groovy to talk to the files not FMP

 

see this thread for some help

http://fmforums.com/forums/topic/97195-file-paths-using-script-master/

Edited by john renfrew
Link to comment
Share on other sites

  • 4 weeks later...

A little late reply but thanks.

Brings me to another question.
I tried to use the script 'CreateFolder' with no luck.

I have a field (directory) with the information 'file:/macdrive/Users/koen/Desktop/ttt/'
With the create PDF command from filemaker I used this info to create a PDF. So pathname to the tat directory is correct.
Now I wanted to use the 'CreateFolder' command. So after the 'ttt' I put 'newfolder'. So I made a variable $dir with the following content : 

filemac:/macdrive/Users/koen/Desktop/ttt/newfolder

so I created a script line :

set field [ test database::report ; CreateFolder ( $dir ) ]

report is the field where I should get the result if the script was done successfully.
As result I don't get a 1 or a 0 but ERROR. And the folder is not created. What am I doing wrong?

Cheers

Koen
 

Link to comment
Share on other sites

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