< Day Day Up > |
External application functions handle operations that are related to the Macromedia Flash application and to the browsers and external editors that are defined in the Preview in Browser and External Editors preferences. These functions let you get information about these external applications and open files with them. dreamweaver.browseDocument()Availability Dreamweaver 2; enhanced in 3 and 4. Description Opens the specified URL in the specified browser. Arguments fileName, {browser}
Returns Nothing. Example The following function uses the dreamweaver.browseDocument() function to open the Hotwired home page in a browser: function goToHotwired(){ dreamweaver.browseDocument('http://www.hotwired.com/'); } In Dreamweaver 4, you can expand this operation to open the document in Microsoft Internet Explorer using the following code: function goToHotwired(){ var prevBrowsers = dw.getBrowserList(); var theBrowser = ""; for (var i=1; i < prevBrowsers.length; i+2){ if (prevBrowsers[i].indexOf('Iexplore.exe') != -1){ theBrowser = prevBrowsers[i]; break; } } dw.browseDocument('http://www.hotwired.com/',theBrowser); } For more information on the dreamweaver.getBrowserList() function, see "dreamweaver.getBrowserList()" on page 652. dreamweaver.getBrowserList()Availability Dreamweaver 3. Description Gets a list of all the browsers in the File > Preview in Browser submenu. Arguments None. Returns An array that contains a pair of strings for each browser in the list. The first string in each pair is the name of the browser, and the second string is its location on the user's computer, which is expressed as a file:// URL. If no browsers appear in the submenu, the function returns nothing. dreamweaver.getExtensionEditorList()Availability Dreamweaver 3 Description Gets a list of editors for the specified file from the External Editors preferences. Arguments fileURL
Returns An array that contains a pair of strings for each editor in the list. The first string in each pair is the name of the editor, and the second string is its location on the user's computer, which is expressed as a file:// URL. If no editors appear in Preferences, the function returns an array that contains one empty string. Example A call to the dreamweaver.getExtensionEditorList(".gif") function might return an array that contains the following strings:
dreamweaver.getExternalTextEditor()Availability Dreamweaver 4. Description Gets the name of the currently configured external text editor. Arguments None. Returns A string that contains the name of the text editor that is suitable for presentation in the user interface (UI), not the full path. dreamweaver.getFlashPath()Availability Dreamweaver MX. Description Gets the full path to the Flash MX application in the form of a file URL. Arguments None. Returns An array that contains two elements. Element [0] is a string that contains the name of the Flash MX editor. Element [1] is a string that contains the path to the Flash application on the local computer, which is expressed as a file:// URL. If Flash is not installed, it returns nothing. Example The following example calls the dw.getFlashPath() function to obtain the path to the Flash application and then passes the path in the form of a file://URL to the dw.openWithApp() function to open the document with Flash: var myDoc = dreamweaver.getDocumentDOM(); if (dreamweaver.validateFlash()) { var flashArray = dreamweaver.getFlashPath(); dreamweaver.openWithApp(myDoc.myForm.swfFilePath, flashArray[1]); } dreamweaver.getPrimaryBrowser()Availability Dreamweaver 3. Description Gets the path to the primary browser. Arguments None. Returns A string that contains the path on the user's computer to the primary browser, which is expressed as a file:// URL. If no primary browser is defined, it returns nothing. dreamweaver.getPrimaryExtensionEditor()Availability Dreamweaver 3. Description Gets the primary editor for the specified file. Arguments fileURL
Returns An array that contains a pair of strings. The first string in the pair is the name of the editor, and the second string is its location on the user's computer, which is expressed as a file:// URL. If no primary editor is defined, the function returns an array that contains one empty string. dreamweaver.getSecondaryBrowser()Availability Dreamweaver 3. Description Gets the path to the secondary browser. Arguments None. Returns A string that contains the path on the user's computer to the secondary browser, which is expressed as a file:// URL. If no secondary browser is defined, it returns nothing. dreamweaver.openHelpURL()Availability Dreamweaver MX. Description Opens the specified Help file in the operating system Help viewer. Dreamweaver displays help content in the standard operating system help viewer instead of a browser. Help content is in HTML, but it is packaged for Windows HTML Help or Help Viewer for Mac OS X. The following four types of files comprise the full help content. For more information on Help files, see your operating system documentation.
Arguments bookID
Returns A value of TRue if successful; false if Dreamweaver cannot open the specified file in the help viewer. Example openHelpURL("DW_Using:index.htm"); dreamweaver.openWithApp()Availability Dreamweaver 3. Description Opens the specified file with the specified application. Arguments fileURL, appURL
Returns Nothing. dreamweaver.openWithBrowseDialog()Availability Dreamweaver 3. Description Opens the Select External Editor dialog box to let the user select the application with which to open the specified file. Arguments fileURL
Returns Nothing. dreamweaver.openWithExternalTextEditor()Availability Dreamweaver 3. Description Opens the current document in the external text editor that is specified in the External Editors entry in the Preferences dialog box. Arguments None. Returns Nothing. dreamweaver.openWithImageEditor()Availability Dreamweaver 3. Description Opens the named file with the specified image editor. NOTE This function invokes a special Macromedia Fireworks integration mechanism that returns information to the active document if Fireworks is specified as the image editor. To prevent errors if no document is active, this function should never be called from the Site panel. Arguments fileURL, appURL
Returns Nothing. dreamweaver.validateFlash()Availability Dreamweaver MX. Description Determines whether Flash MX (or a later version) is installed on the local computer. Arguments None. Returns A Boolean value: true if Flash MX (or a later version) is installed on the local computer; false otherwise. |
< Day Day Up > |