Matt Klein Posted May 31, 2007 Posted May 31, 2007 Hi All - I have a problem with one computer at one of my customer locations. I know it's an environmental problem, but I was hoping some of you might have some tidbits to share that would point me in a direction to resolve it. I use the Open URL script step to open a file on the local computer. On this one computer, the Open URL script step will not open a file on the local computer at all. It will, however, open a website in a browser. Here's what I have done in testing it: I created a test script: Open URL["file://C:/Test.txt"] Show Custom Dialog[Get(LastError)] When I run the script, the file doesn't open and the dialog box shows "0" as the last error. I tried the same script with other file types such as .fp7 and .htm with the same result. My last test was to enter an actual web address into the Open URL step. When I ran the script, it opened a web browser and went to the URL I entered. So, it seems that the Open URL script step works fine for opening actual web pages on this computer, but will not open files that reside on the computer. FYI, the OS is Windows 2003 Server and a domain administrator was logged in. Anyone have any ideas?
Genx Posted May 31, 2007 Posted May 31, 2007 Okay, try the following combinations: Open URL["C:/Test.txt"] Open URL["C:Test.txt"] It should reformat (at least on IE) to the appropriate format. Secondly... why aren't you using send event for this? I.e. Send Event["C:Test.txt"] Thirdly... I'm not thinking that Server 2003 is a supported platform for FM Pro so if some things don't work your not really going to be able to complain a whole lot.
Matt Klein Posted June 1, 2007 Author Posted June 1, 2007 Thanks for the reply Genx. The combinatinos you suggested did not make a difference. I don't use Send Event because send event doesn't seem to like paths with spaces in them. The file that I really open with the application is in the user's preferences directory which has a path on Windows similar to: C:Documents and SettingsmkleinLocal SettingsApplication Data The Open URL command in this application works on all other workstations that this application has ever been used on including another Windows 2003 Server at the same location. FYI, They are using Windows 2003 Server to deploy FileMaker Pro under Citrix. Several of our other clients use this same setup, Citrix, so I know it's not the Citrix environment. FYI, I ended up solving this problem by using Troi's File plug-in to launch the file, but I would still love any other input from other developers with regards to the Open URL problem. Lastly, I really don't believe this is a FileMaker problem so no complaints from me about FileMaker.
Genx Posted June 3, 2007 Posted June 3, 2007 Alright, try this: Let( x = Substitute( filepath ; [ " " ; "%20"] ; ["" ; "/" ]); "file:///" & x ) Where filepath is your FilePath Field
elanahy Posted December 4, 2008 Posted December 4, 2008 Hi, I know this was posted a while back but I just wanted to say Thank You! I was using Send Event and using the calculation option for the file path and it was only working on path and files with no spaces. I added in your subsituion suggestion to the path and now it works for all paths with spaces as well. Thank you. Also will this be a problem on a network if I use the subsitution, in other words are there any cases where the subsitution is not needed and it will not work if it is done? Thanks again.
MacEasy Computing Inc Posted April 18, 2014 Posted April 18, 2014 Has anyone ever gotten this to work with a filemaker file? I've tried Open URL, but it doesn't work consistently, even with the substitute command for spaces I've tried Open URL fmp://.... but this doesn't seem to be recognized for local files. Any help would be greatly appreciated. Trying to download a filemaker file stored in a container field and then open it.
Wim Decorte Posted April 18, 2014 Posted April 18, 2014 You have to post a little more information about what exactly does not work, post the full URL you are using and that will help us figure things out. You mention trying to download a FM file stored in a container: does that part work? Also post full info your OS and FM version
MacEasy Computing Inc Posted April 18, 2014 Posted April 18, 2014 Hi, thanks for responding. Because OPEN URL (file:///Volumes/Macintosh HD/Users/peter/Documents/localfile.fp7") doesn't always return an error, often returns 0 even when the file wasn't opened. OPEN URL (fmp7:///Volumes/Macintosh HD/Users/peter/Documents/localfile.fp7") but this doesn't seem to work, or I have a syntax problem somewhere. I did find one issue. It seems in older filemaker versions you had to substitute for spaces in your URL, but it seems that if you are opening a filemaker file in at least filemaker 11 and later it actually doesn't understand the substitution for spaces. For Example previously you had to use substitute for spaces with "%20", but that now seems to break the filepath on Mac, haven't tested on windows yet. "file:///Volumes/Macintosh HD/Users/peter/Documents/localfile.fp7" vs. for older solutions "file:///Volumes/Macintosh%20HD/Users/peter/Documents/localfile.fp7" The substitution mentioned above by GENx for forward slashes still seems to be a good one.
Wim Decorte Posted April 18, 2014 Posted April 18, 2014 I'm still a little confused, your profile mentions FM13 but your example mentions the fmp7 protocol... so what version of FM are you trying this on? The OPEN URL script step automatically encodes the URL so if you manually put "%20" for spaces then the "%" will be encoded again and things will break. Since you're inside FM and you want to open another FM file, why not use a real FM file reference?
bcooney Posted April 18, 2014 Posted April 18, 2014 "The OPEN URL script step automatically encodes the URL so if you manually put "%20" for spaces then the "%" will be encoded again and things will break." Really? I have not found that to be the case. From the KB Answer ID: 5560: "URLs cannot contain spaces. If your database name has spaces in it, replace those spaces with plus signs (“+”)"
Wim Decorte Posted April 19, 2014 Posted April 19, 2014 http://www.goya.com.au/blog/insert-url-and-encoding Is some pretty good reading on the subject of "insert from URL" and its automatic encoding. As opposed to the Web Viewer where you have the option to override the automatic encoding. I ran across the issue big time when I was writing chapter 9 for the new FTS and trying to find good demos for the new HTTP POST that can be done with "Insert from URL"
bcooney Posted April 19, 2014 Posted April 19, 2014 Perhaps there is different behavior between Insert from URL and OpenURL?
Recommended Posts
This topic is 3870 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