October 23, 200916 yr I want to use Open URL to open a pdf file. It works fine if I use the complete, absolute path name. But it fails when I try to use a relative path name. I want a relative path name because the pdf will be a help file in a runtime solution. I want to have the pdf file in the same folder as the database. Can someone tell me the correct expression for this.
October 23, 200916 yr I think get(filename) will give you what you need. Returns the path to the current FileMaker file... based on that, you should know where your PDF is. Hope that helps. James
October 23, 200916 yr Author I think you meant Get (FilePath) not Get (FileName). In any case Get (FilePath) returns the absolute file path. I already can get that to work. What I want is to be able to use the relative file path. Perhaps there an issue with Open URL and relative file paths?
October 23, 200916 yr I think Mr. Drucker's thought was that since the Filemaker function is returning (giving you) the full path why do you need the relative path?
October 23, 200916 yr You need both the absolute path to where you are, calculating the folder path from the file path. Then add the relative path from there. The first is where you "start from", the 2nd is where you "go to". In the end, yes, you have an absolute path. The URL paths you may be used to work as relative paths only because they know where they are starting from in the first place.
October 23, 200916 yr Author The pdf file will be a users guide for a runtime solution I am developing. I want to put the user guide pdf file in the same folder with the runtime solution so it will work on any computer it's installed on and even if the customer moves the runtime folder, the script will still be able to find the pdf file. That's why I want to use a relative path. I don't know if Open URL is the way to do what I want. Any suggestions would be welcome.
October 24, 200916 yr Open URL is a great way to do it. But you need a calculation to convert the FileMaker file's local path into its folder path, then add the relative folder path. See example file (with a Pictures folder, but you get the idea). Open_File_wURL.zip
Create an account or sign in to comment