4D v16.3OPEN URL |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
OPEN URL
OPEN URL
The OPEN URL command opens the file or URL passed in the path parameter with the application indicated in appName (if any). The path parameter can contain either a standard URL or a file pathname. The command accepts colons (':') under OS X, slashes ('\') under Windows or a Posix URL beginning with file://. If the appName parameter is omitted, 4D first attempts to interpret the path parameter as a file pathname. If this is the case, 4D will request the system to open the file using the most suitable application (for example, a browser for .html files, Word for .doc files, etc.). The * parameter is ignored in this case. When the appName parameter is passed, the command interrogates the system. If an application with this name is installed, it is started and the command requests it to open the specified URL or document.
Note: You will find the list of applications installed in the registry at the following key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths Under OS X, the mechanism uses the Finder which automatically indexes all the applications installed. It can recognize any .app application by means of its package name (with or without the .app suffix). For example, you could pass:
When the appName application is not found, no error is returned; the command is run as if this parameter had not been specified. 4D automatically encodes the URL’s special characters. If you pass the * character, 4D will not translate the URL’s special characters. This option allows you to access and to send URLs of the type: "http://www.server.net/page.htm?q=something". Note: This command does not work when called from a Web process. The following examples illustrate different types of strings that are accepted as URLs by the command: OPEN URL("http://www.4d.com") This example can be used to launch the most suitable application: $file:=Select document("";"";0) The appName parameter lets you open the same text file using different applications: OPEN URL("C:\\temp\\cookies.txt") //open the file with Notepad
|
PROPERTIES
Product: 4D
HISTORY
Modified: 4D v11 SQL Release 2 ARTICLE USAGE
4D Language Reference ( 4D v16) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||