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.

Windows vs. Mac File Path

Featured Replies

Hi Guys,

this is probably an easy one for someone who knows windows... I can't figure it out and would appreciate a tip.

My database has a scripted Excel export function. I've chosen to name the files Excel_11807.xls, and collect them in a designated directory "Lasting Record Data/Excel Export". I'm using the Get(FileMakerPath) function to locate the directory, as it is located in the same folder as my runtime solution (or FileMaker application for the time being).

On the Mac, the following calculation works flawlessly:

Substitute (

Get(FileMakerPath) & "Excel" & (Substitute (Get(CurrentDate); "/"; "")) & ".xls" ;

"Excel" & Substitute (Get(CurrentDate); "/"; "") & ".xls" ;

"Lasting Record Data/Excel Expor/t" & "Excel" & Substitute (Get(CurrentDate); "/"; "") & ".xls"

)

However, in my windows test-environment (WIN XP, SR3) it returns: "Excel_11807.xls could not be created. Use a different name..."

How do I need to change the path for it to work in a windows environment??

Thank you so much for your input!

I am surprised this works at all as your target filename does not have a prefix that FM needs to determine the platform and protocol.

file: is relative

filemac: is mac absolute

filewin: is windows absolute

Should work if you just prefix with "file:"

If not then maybe the file already exists and is locked, or the directory does not exist.

Incidentally, where did the underscore come from in the Windows message as it's not in your calculation.

It seems you've got a lot of extra Substituting in the calculation. Also, my preference is to create a sortable date stamp for file names in folders, yearmonthday, padding the month and day. I think an absolute path prefix is best, as those FileMaker path functions return absolute paths (they would have to on client machines).

I would also prefer to use the Documents folder, Get ( DocumentsPath ). Exported documents don't belong in the application folder, IMHO.

Let ( [

prfx = Case ( Abs ( Get ( SystemPlatform)) = 1; "filemac:"; "filewin:" );

yr = Year ( Get ( CurrentDate ));

m = Right ( "0" & Month ( Get ( CurrentDate )); 2);

d = Right ( "0" & Day ( Get ( CurrentDate )); 2)

];

prfx & Get(DocumentsPath) & "Lasting Record Data/Excel Export/Excel_" & yr & m & d & ".xls"

)

  • Author

Hey Fenton and IdealData!

Thank you so much for your input - it works like a charm. I've been reading in another post, "It's always the obvious in the end..." - I guess that goes for this one too.

Funny that my mac file paths always worked without the filemac: prefix...

Fenton, the reason I've placed the document folder in the runtime application folder is because A) I don't have an installer app to place things automatically in different spots, :) the users are really computer illiterate - I thought it would make their lives easier.

Cheers,

Michael

Ah yes, Runtime returns its own app path. That is fine. A local FileMaker file can also return its own path.

  • 2 months later...

Sorry to reopen this thread, but i can't get it to work:

i've made this script:

Set Variable [ $percorsoDesktop; Value:Get ( PercorsoDesktop ) ] 

Save record as PDF [ filename: “filewin:$percorsoDesktop”; Create e-mail; current record ] 



but every time i launch it, i have the error message n.800 "unable to write to disk...."

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.