December 22, 20169 yr 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… Quote “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. Karlos.
December 22, 20169 yr 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” )
Create an account or sign in to comment