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.

List All Files in Directory

Featured Replies

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 

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

  • 4 weeks later...
  • Author

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
 

  • Author

Got it.
My mistake. I discovered that 'Volumes' is needed before my drive name. Now to discover how to extract that within filmaker.

Cheers

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.