action:Custom_HTML_Prompt
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| action:Custom_HTML_Prompt [2017/10/04 06:51] – [Using JavaScript] peternlewis | action:Custom_HTML_Prompt [2021/12/11 15:14] (current) – [HTML Window Design] peternlewis | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | {{: | ||
| ====== Custom HTML Prompt Action ====== | ====== Custom HTML Prompt Action ====== | ||
| Line 14: | Line 13: | ||
| - If you want default values in the form, set these // | - If you want default values in the form, set these // | ||
| - Execute the //Custom HTML Prompt// Action | - Execute the //Custom HTML Prompt// Action | ||
| - | * The HTML code can be in a file, or as text in the Action | + | * The HTML code can be in a '' |
| - When the User clicks on the OK button, the //Keyboard Maestro Variables// will be updated | - When the User clicks on the OK button, the //Keyboard Maestro Variables// will be updated | ||
| - Use these // | - Use these // | ||
| Line 22: | Line 21: | ||
| By default, the window floats above all others, but you can optionally turn off *Floating* (v8+) in the gear BUTTON{{{⚙}}} menu. | By default, the window floats above all others, but you can optionally turn off *Floating* (v8+) in the gear BUTTON{{{⚙}}} menu. | ||
| - | You can optionally turn on *Resizable* (v8+) in the gear BUTTON{{{⚙}}} menu. | + | You can optionally turn on *Resizable* (v8+), make the window *Transparent* (v10.0+), or turn off the *Window Title Bar* (v10.0+) in the gear BUTTON{{{⚙}}} menu. |
| You design the HTML form using standard HTML code, which can be stored in either a file or as text in the Action. | You design the HTML form using standard HTML code, which can be stored in either a file or as text in the Action. | ||
| Line 54: | Line 53: | ||
| ```sh | ```sh | ||
| - | defaults write com.stairways.keyboardmaestro.engine WebKitDeveloperExtras | + | defaults write com.stairways.keyboardmaestro.engine WebKitDeveloperExtras |
| ``` | ``` | ||
| Line 115: | 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( " | + | | `window.KeyboardMaestro.ResizeWindow( " |
| - | | window.KeyboardMaestro.GetVariable( ' | + | | `window.KeyboardMaestro.GetVariable( ' |
| - | | window.KeyboardMaestro.SetVariable( ' | + | | `window.KeyboardMaestro.SetVariable( ' |
| - | | window.KeyboardMaestro.ProcessTokens( ' | + | | `window.KeyboardMaestro.GetDictionary( ' |
| - | | window.KeyboardMaestro.Calculate( '10 + 32' ) | returns the result of the calculation | | + | | `window.KeyboardMaestro.SetDictionary( ' |
| - | | window.KeyboardMaestro.Trigger( macro, value ) | triggers the specified macro (7.1+) | | + | | `window.KeyboardMaestro.ProcessTokens( ' |
| + | | `window.KeyboardMaestro.ProcessAppleScript( 'tell app " | ||
| + | | `window.KeyboardMaestro.Calculate( '10 + 32' )` | returns the result of the calculation | | ||
| + | | `window.KeyboardMaestro.Trigger( macro, value )` | triggers the specified macro (7.1+) | | ||
| + | | `window.KeyboardMaestro.Log( ' | ||
| Prior to version 7.1, using SetVariable to set a value to something other than a string can [corrupt the variable](https:// | Prior to version 7.1, using SetVariable to set a value to something other than a string can [corrupt the variable](https:// | ||
| - | |||
| ==== Form Validation ==== | ==== Form Validation ==== | ||
| Line 160: | Line 162: | ||
| * [[action: | * [[action: | ||
| * [[action: | * [[action: | ||
| + | * [[action: | ||
| * [[action: | * [[action: | ||
| * [[action: | * [[action: | ||
| * [[action: | * [[action: | ||
| + | * [[action: | ||
| * [[: | * [[: | ||
| Line 179: | Line 183: | ||
| - [[https:// | - [[https:// | ||
| - [[https:// | - [[https:// | ||
| + | - [Resizing Window Using Current Position](https:// | ||
| - [[https:// | - [[https:// | ||
| - [[https:// | - [[https:// | ||
| + | |||
| ==== External References ==== | ==== External References ==== | ||
| Line 186: | Line 192: | ||
| There are a wide variety of Web/HTML editors available. | There are a wide variety of Web/HTML editors available. | ||
| - | * [TextWrangler](http:// | + | * [BBEdit](http:// |
| - | * [BlueGriffon](http://bluegriffon.org/) -- a free, but powerful, WYSIWYG content | + | * [Atom](https://atom.io/) -- A hackable text editor |
| - | * FIXME Wiki editors: | + | * [Visual Studio Code](https://code.visualstudio.com/ |
action/Custom_HTML_Prompt.1507099919.txt.gz · Last modified: by peternlewis
