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 Directory in Windows

Featured Replies

Hi

I've created the following applescript to create folders and open the resulting folder based on field info from two tables

"tell application " & QMK & "Finder" & QMK & "¶"&

"set clientsfolder to folder "& QMK & Our Company Data::Company Client Folder & QMK & " of folder "& QMK &Our Company Data::Company Folder&QMK& " of disk " & QMK & Our Company Data::Company Drive & QMK & " as string" & "¶"&

"if not (exists folder " & QMK & Contacts::Company & QMK & " of folder " &QMK&Our Company Data::Company Client Folder&QMK&" of folder " & QMK&Our Company Data::Company Folder&QMK & " of disk " & QMK & Our Company Data::Company Drive & QMK & ") then " &"¶"&

"make new folder at folder clientsfolder with properties {name: " & QMK & Contacts::Company & QMK &"}" & "¶" &

"end if" & "¶" &

"set jobfolder to folder "& QMK & Contacts::Company &QMK & " of folder "& QMK & Our Company Data::Company Client Folder & QMK & " of folder "& QMK &Our Company Data::Company Folder&QMK& " of disk " & QMK & Our Company Data::Company Drive & QMK & " as string" & "¶"&

"if not (exists folder " & QMK & Our Company Data::Company Initials &" #"& Job ID &" - " &Name & QMK & " of folder jobfolder) then " &"¶"&

"make new folder at folder jobfolder with properties {name: " & QMK & Our Company Data::Company Initials& " #"& Job ID &" - " &Name &QMK&"}" & "¶" &

"end if" & "¶"&

"set jobfolder1 to folder "&QMK&Our Company Data::Company Initials&" #"& Job ID &" - " &Name & QMK & " of folder "& QMK & Contacts::Company &QMK & " of folder "& QMK & Our Company Data::Company Client Folder & QMK & " of folder "& QMK &Our Company Data::Company Folder&QMK& " of disk " & QMK & Our Company Data::Company Drive & QMK & " as string" & "¶"&

"activate" & "¶"&

"make new Finder window to jobfolder1"& "¶"&

"end tell"

I would like to make a similar version for Windows. Can anyone help as I'm completely lost in the windows world?

Thanks

Jonathan

Do you have an English version of what you are trying to accomplish?

  • Author

I would like to have a button on a page that will create a folder within a directory on our server for a job database.

The structure is as follows:

Company Work Drive - Company Folder on Network Drive (there are three companies that use the same server)

Clients folder - Name of folder where clients are stored

Client Company folder - a Folder for each company

Job Folder - Where documents are stored. Created from Job ID & Job name fields

In windows the structure would be serverCompany Work DriveClients FolderClient Company FolderJob Folder

(serverDataClientsACustomerJob#12)

I would like the script to check to see if Client Company folder exists, and if not create it based on the value of that field.

I would then it to check to see if the Job folder exists, otherwise I would like it to create the Job Folder within the Client Company Folder.

Finally I want it to open the folder. Hopefully that makes it clearer. I have seen this done in an access database using vb script, but don't know how to run vb script in FM. Below is the vb script. The field names are slightly different, but hopefully it is clear.

VB Script

Private Sub Create_Directory_Click()

'On Error GoTo Err_Create_Directory_Click

Dim strclientpath As String

Dim strjobpath As String

strclientpath = Me![DocLocation] & "" & Me![Company] & ""

strjobpath = Me![DocLocation] & "" & Me![Company] & "" & Me![OurCompanyInitials] & " #" & Me![JobID] & " - " & Me![Job Description] & ""

If Dir(strclientpath, vbDirectory) > vbNullString And Dir(strjobpath, vbDirectory) > vbNullString Then

Exit Sub

ElseIf Dir(strclientpath, vbDirectory) > vbNullString Then

MkDir strjobpath

Exit Sub

Else

MkDir strclientpath

MkDir strjobpath

To script this use:

Set Variable[$filepath; Value:serverDataClientsAC ustomerJob_12]

Send Event["aevt"; "odoc"; "CMD /C MD " & $filepath]

Open URL[No dialog; $filepath

"CMD /C MD " & $filepath

In English:

Set a script variable for the filepath.

Add the CMD operators to perform the making of directories and execute it.

Open the folder.

Note:

You will require the the necessary write permissions to be able to perform this.

I have not tested this on in a server environment, only on my local machine.

To perform VB from FileMaker export the VB code to a file and call the file.

  • Author

Thanks. I will give it a go.

Can I create a vb script dynamically from a calculated field and run it or does it have to be external? Can I create it and export to a temp file and run that?

Yes, create the file dynamically and export it to a temp location.

  • Author

thanks for your help Mark

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.