Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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?

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.

  • Author

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.

Alright, try this:

Let(

x = Substitute( filepath ; [ " " ; "%20"] ; ["" ; "/" ]);

"file:///" & x

)

Where filepath is your FilePath Field

  • 1 year later...

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.

  • 5 years later...

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. 

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

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.

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?

"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 (“+”)"

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"

Perhaps there is different behavior between Insert from URL and OpenURL?

Could very well be...

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.