Jump to content
Karlos Fandango

Get (FilePath) not working

Recommended Posts

Hi, I wonder if anyone can help. I have a folder on my desktop called “quotes” and have a working script that saves quotes in a PDF format to that folder.

1). This works just fine…

Get ( DesktopPath )  & "/" & "quotes" & "/" &  Quotes::Quote_Pk & "-Quote.pdf"

2). But can anyone tell me why this doesn’t…

Get ( FilePath )  & "/" & "quotes" & "/" &  Quotes::Quote_Pk & "-Quote.pdf”

…using the second I get the following error message…


“Q-00272-Quote.pdf” could not be created on this disk.  Use a different name, make more room on the disk, unlock it or use a different disk.

I need the second script to work because we have had to move the database as well as the "quotes” folder, to another location.

Any help would be greatly appreciated.



Share this post

Link to post
Share on other sites

The Get ( FilePath ) function returns the full path to your solution file - including the filename. It makes no sense to append a "/" to the result.

If you want to calculate a path relative to your solution file, you must start by removing the filename from the path returned by Get ( FilePath ). For example, if the folder named "quotes" is in the same folder as your solution file, the following should work as the path for the saved PDF file:

Let ( [
path = Get ( FilePath ) ;
pos = Position ( path ; "/" ; Length ( path ) ; - 1 ) ;
dir = Left ( path ; pos )
] ;
dir & "quotes/" & Quotes::Quote_Pk &"-Quote.pdf”


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.