This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
action:Custom_HTML_Prompt [2021/10/15 04:31] peternlewis [External References] |
action:Custom_HTML_Prompt [2021/10/15 04:43] peternlewis [Using JavaScript] |
||
---|---|---|---|
Line 114: | Line 114: | ||
^ Function ^ Called ^ | ^ Function ^ Called ^ | ||
- | | KMInit() | to initialize fields or other features| | + | | `KMInit()` | to initialize fields or other features| |
- | | KMWindow() | to return the desired size or frame of the window as a string| | + | | `KMWindow()` | to return the desired size or frame of the window as a string| |
- | | KMWillShowWindow() | when the window will be shown| | + | | `KMWillShowWindow()` | when the window will be shown| |
- | | KMDidShowWindow() | when the window was just shown (v7.1+) | | + | | `KMDidShowWindow()` | when the window was just shown (v7.1+) | |
- | | KMHandleSchemes() | to return the schemes you wish to handle within the web page (v8+) | | + | | `KMHandleSchemes()` | to return the schemes you wish to handle within the web page (v8+) | |
- | | KMWillCloseWindow() | called when the window is about to be closed (v8.0.3+) | | + | | `KMWillCloseWindow()` | called when the window is about to be closed (v8.0.3+) | |
From within the window, you can call the following functions: | From within the window, you can call the following functions: | ||
^ Function ^ Purpose ^ | ^ Function ^ Purpose ^ | ||
- | | window.KeyboardMaestro.Submit( buttonName ) | submit the form and write the *Keyboard Maestro Variables* | | + | | `window.KeyboardMaestro.Submit( buttonName )` | submit the form and write the *Keyboard Maestro Variables* | |
- | | window.KeyboardMaestro.Cancel( buttonName ) | close the window, do not write the *Keyboard Maestro Variables* | | + | | `window.KeyboardMaestro.Cancel( buttonName )` | close the window, do not write the *Keyboard Maestro Variables* | |
- | | window.KeyboardMaestro.ResizeWindow( "1,2,3,4" ) | resize the window to the specified size or frame as a string with commas ("width,height" or "left,top,width,height")\\ Also see [Resizing Window Using Current Position](https://forum.keyboardmaestro.com/t/resizing-html-window-with-javascript-keyboardmaestro-resizewindow-moves-it/21579/7) | | + | | `window.KeyboardMaestro.ResizeWindow( "1,2,3,4" )` | resize the window to the specified size or frame as a string with commas ("width,height" or "left,top,width,height")\\ Also see [Resizing Window Using Current Position](https://forum.keyboardmaestro.com/t/resizing-html-window-with-javascript-keyboardmaestro-resizewindow-moves-it/21579/7) | |
- | | window.KeyboardMaestro.GetVariable( 'KMVariableName' ) | returns the value of a variable | | + | | `window.KeyboardMaestro.GetVariable( 'KMVariableName' )` | returns the value of a variable | |
- | | window.KeyboardMaestro.SetVariable( 'KMVariableName', 'value' ) | sets the value of a variable | | + | | `window.KeyboardMaestro.SetVariable( 'KMVariableName', 'value' )` | sets the value of a variable | |
- | | window.KeyboardMaestro.GetDictionary( 'Dictionary', 'Key' ) | returns the value of a dictionary entry | | + | | `window.KeyboardMaestro.GetDictionary( 'Dictionary', 'Key' )` | returns the value of a dictionary entry | |
- | | window.KeyboardMaestro.SetDictionary( 'Dictionary', 'Key', 'value' ) | sets the value of a dictionary entry | | + | | `window.KeyboardMaestro.SetDictionary( 'Dictionary', 'Key', 'value' )` | sets the value of a dictionary entry | |
- | | window.KeyboardMaestro.ProcessTokens( '%ShortDate%' ) | returns the text token expansion | | + | | `window.KeyboardMaestro.ProcessTokens( '%ShortDate%' )` | returns the text token expansion | |
- | | window.KeyboardMaestro.Calculate( '10 + 32' ) | returns the result of the calculation | | + | | `window.KeyboardMaestro.ProcessAppleScript( 'tell app "Finder" to activate' )` | executes the AppleScript and returns the result (v10.0+) | |
- | | window.KeyboardMaestro.Trigger( macro, value ) | triggers the specified macro (7.1+) | | + | | `window.KeyboardMaestro.Calculate( '10 + 32' )` | returns the result of the calculation | |
+ | | `window.KeyboardMaestro.Trigger( macro, value )` | triggers the specified macro (7.1+) | | ||
Prior to version 7.1, using SetVariable to set a value to something other than a string can [corrupt the variable](https://forum.keyboardmaestro.com/t/corrupted-variables-after-custom-html-setvariable-update-i-fixed-it-please-read/2881). | Prior to version 7.1, using SetVariable to set a value to something other than a string can [corrupt the variable](https://forum.keyboardmaestro.com/t/corrupted-variables-after-custom-html-setvariable-update-i-fixed-it-please-read/2881). |