mporter Posted October 23, 2009 Posted October 23, 2009 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.
jamesducker Posted October 23, 2009 Posted October 23, 2009 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
mporter Posted October 23, 2009 Author Posted October 23, 2009 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?
Ted S Posted October 23, 2009 Posted October 23, 2009 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?
Fenton Posted October 23, 2009 Posted October 23, 2009 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.
mporter Posted October 23, 2009 Author Posted October 23, 2009 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.
Fenton Posted October 24, 2009 Posted October 24, 2009 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
DykstrL Posted November 13, 2009 Posted November 13, 2009 Very nice solution. Now, how to make it work in Windows 7.
Recommended Posts
This topic is 5489 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now