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.

Create a directory with values from a filemaker 8 DB

Featured Replies

Hello,

Is it possible to have a button in my filemaker database create a set of directories on our file server (with the names of the directories determined by the values of a field from filemaker)?

Also, I currently link to files on our server using the "open URL" script attached to a button. This works fine on Tiger (the web browser just passes and afp:// link to the finder), but on Panther it comes up as a page not found in the default web browser. Is there a better way to do this?

Cheers,

Edited by Guest

To create folders on a server the user (or the OS script triggered by the user) needs to have the necessary privileges to do that.

other than that, it's entirely possible. 2 ways to go about it:

- use a file plugin: very easy. Costs some money and you need to deploy the plugin

- or use OS level scripting (AppleScript on Mac, VBscript on Windows=: free but you need to figure out how it's done on both platforms.

check out the downloads section on my website for a VBscript repository (www.connectingdata.com).

  • Author

Thanks Wim, I will have a look at your site.

  • 3 weeks later...

Here is a bare-bones applescript to make a directory. Note -- this has no error checking, so be really careful until you are sure it is working!

To test, remove the two dashes (--) on the "display dialog..." line, and add two dashes to the "set theResult" line.

// Applescript --> Shell script which makes folders

"tell application "Finder"¶" &

" set cmd to "mkdir -p '" & $path & "'"" & ¶ &

" -- display dialog "command" & return & cmd buttons {"OK"}¶" &

" set theResult to do shell script cmd¶" &

" return theResult¶" &

"end tell"

  • 1 year later...

You can simplify the above Applescript to a single line since you don't need any of the 'tell application finder' stuff from within FMP.

- Create a new script and add a 'Perform Applescript' step.

- Select 'Calculated Applescript' and hit the 'Specify' button.

- Add this calculation: -

"do shell script "mkdir -p ~/Desktop/'" & Get ( ScriptParameter ) & "'""

- Click 'OK' to exit the calculation and 'OK' again to exit the script.

You can then call this script from any other script with your folder name as a script parameter. Alternatively you could replace "Get(ScriptParameter)" with "$somevariablename" or "" if you prefer.

In this example I used ~/Desktop to specify the path although you could just as easily pass a full path as part of the script parameter or as a variable like this:-

set variable $pathtocreate = "/Volumes/Local/MyFolder"

"do shell script "mkdir -p '" & $pathtocreate & "'""

NB - It is important to notice the single and double quotes in the shells script, if you get these wrong it wont work!

Hope this helps.

Codeus

  • 6 months later...

Codeus, I have a like situation and getting hung up on the single and double quote syntax in FM. I've set the variable for an CLI app that resides in a folder with the fm solution -

Set Variable $path = CNSImage_File_GetPathToDB & "/bin/wacaw --VGA capture"
 - 



I'm using the CNS image plugin to return the path to the db, so if the user moves the solution folder around, we can always find the executable. I've verified that it's returning the correct path with Data viewer and I can paste it in Terminal and get the result I want. However, on the next script step Perform Applescript (calculated), 




"do shell script "$path""

I get nuthin'.... I know I've got to get single quotes in the calcuation, but damned if I can figure out where FM wants them. ?? TIA! :)

You've got to get the script variable outside the quotes; otherwise it's just text.

"do shell script "" & $path & """

Thanks Fenton, I owe ya another one! :)

Thanks Fenton, I owe ya another one! :)

I fear the day the FMForum gurus come to collect.

What if they want me to kill someone? How could I possibly deny them?

I shudder to think...

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.