Koen Posted July 30, 2015 Posted July 30, 2015 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
john renfrew Posted July 30, 2015 Posted July 30, 2015 (edited) 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 July 30, 2015 by john renfrew
Koen Posted August 21, 2015 Author Posted August 21, 2015 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
Koen Posted August 21, 2015 Author Posted August 21, 2015 Got it.My mistake. I discovered that 'Volumes' is needed before my drive name. Now to discover how to extract that within filmaker. Cheers
Recommended Posts
This topic is 3393 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