IDE Scripting DoCommand
From Xojo Documentation
Contents
These commands are used to run other scripts or to execute commands that perform an IDE action. These commands are identified by recording a script while using the IDE.
DoCommand(cmdName As String)
Executes the specified IDE command. Refer to Commands used by DoCommand for a list of available commands.
Sample Code
Save the project:
DoCommand("SaveFile")
Commands used by DoCommand
The following commands may be used as parameters to the DoCommand method.
- OpenFile: Displays the Open Project File dialog.
- SaveFile: Saves the current project with no prompt.
- SaveFileAs: Displays the File Save As dialog.
- Import: Displays the import file dialog.
- CloseWindow: Closes the current workspace window.
- RunApp: Runs the current project in debug mode.
- RunPaused: Runs the current project, but does not launch the debug app.
- BuildApp: Builds the current project.
- Print: Displays the print dialog.
- PageSetup: Displays the page setup dialog.
- GoBack: Go backward in tab history.
- GoForward: Go forward in tab history.
- Help: Shows the Language Reference window.
- Library: Toggles the display of the Library.
- Inspector: Toggles the display of the Inspector.
- Find: Toggles display of Find pane.
- ToggleErrors: Not implemented.
- ToggleMessages: Not implemented.
- NewTab: Adds a new tab to the current workspace window.
Project Items
- NewClass: Add a new class to the current project.
- CopyFilesStep: Adds a new Copy Files Step to the current project.
- RunIDEScriptStep: Adds a new Script Step to the current project.
- NewRunExternalScriptStep: Displays file selector dialog to add a new External Script Step to the current project.
- NewInterface: Adds a new interface to the current project.
- NewContainerControl: Adds a new container control to the current project.
- NewFileTypes: Adds a new file type set to the current project.
- NewFolder: Adds a new folder to the current project.
- NewMenuBar: Adds a new menu bar to the current project.
- NewModule: Adds a new module to the current project.
- NewReport: Adds a new report to the current project.
- NewToolbar: Adds a new toolbar to the current project.
- NewWindow: Adds a new window to the current project.
- AddWebPage: Adds a new web page to the current project.
- AddWebDialog: Adds a new web dialog to the current project.
- AddWebStyle: Adds a new web style to the current project.
Project Items Editing
- AddEventImplementation: Displays the Add Event Handler dialog.
- NewMethod: Adds a new method to the selected project item.
- NewProperty: Adds a new property to the selected project item.
- NewNote: Adds a new note to the selected project item.
- NewMenuHandler: Adds a new menu handler to the selected project item.
- NewComputedProperty: Adds a new computed property to the selected project item.
- NewConstant: Adds a new constant to the selected project item.
- NewDelegate: Adds a new delegate to the selected project item.
- NewEnum: Adds a new enumeration to the selected project item.
- NewEvent: Adds a new event definition to the selected project item.
- NewExternalMethod: Adds a new external method to the selected project item.
- NewSharedComputedProperty: Adds a new shared computed property to the selected project item.
- NewSharedMethod: Adds a new shared method to the selected project item.
- NewSharedProperty: Adds a new shared property to the selected project item.
- NewStructure: Adds a new structure to the selected project item.
Editing
- Comment: Add the comment prefix to the selected text in the code editor (or the current line if no text is selected).
- CheckItemErrors: Equivalent to Project ↠ Analyze Item.
- CheckProjectErrors: Equivalent to Project ↠ Analyze Project.
- SelectAll: Selects all the controls for the selected project item. Does not work with the Code Editor. Use SelStart and SelLength instead.
- Copy: Copies the selected item in the Navigator to the clipboard.
- Paste: Pastes the text in the clipboard to the active code editor.
- Cut: Cuts the selected control(s) for the selected project item. Does not work with the Code Editor.
- Undo: Restores the last deleted control(s). Does not work with the Code Editor.
- DeleteSelection: Not implemented.
Layout Editor
- AddFromLibrary: Not implemented.
- EditModeCode: Switch to Code Editor.
- GoToLastEvent: Go to last edited code.
- EditModeView: Switch to Layout Editor.
- StartInlineEditing: Open Default Property popout window.
- LockPositions: Toggle lock for selected control.
- ShowHideTabOrder: Displays Tab Order Editor dialog.
- ToggleMeasurements: Toggle measurements.
- OrderForward: Order selected controls forward.
- OrderToFront: Bring selected controls to front.
- OrderBackward: Order select controls backward.
- OrderToBack: Send selected controls to the back.
- FillWidth: Fill width on the selected control.
- FillHeight: Fill height on the selected control.
- AlignLeft: Aligns the selected controls to the left.
- AlignRight: Aligns the selected controls to the right.
- AlignTop: Aligns the selected controls to the top.
- AlignBottom: Aligns the selected controls to the bottom.
- AlignSpaceHorizontally: Align and space the selected controls horizontally.
- AlignSpaceVertically: Align and space the selected controls vertically.
Menu Editor
- AddMenu: Adds a top-level menu to the menu bar.
- AddMenuItem: Adds a menu item to the selected menu.
- AddMenuSeparator: Adds a separator to the selected menu.
- AddSubmenu: Adds a submenu to the selected menu.
- ConvertToMenu: Converts a submenu item to a top-level menu.
- ViewAsWin32: Changes to the Windows menu view.
- ViewAsOSX: Changes to the macOS menu view.
- ViewAsLinux: Changes to the Linux menu view.
File Types Set Editor
- NewFileType: Adds a new file type to the editor.
- Clear: Removes the selected file type from the editor.
- AddCommonFileType$Pdf: Adds PDF file type.
- AddCommonFileType$Rtf: Adds RTF file type.
- AddCommonFileType$Mp3: Adds MP3 file type.
- AddCommonFileType$Jpeg: Adds Jpeg file type.
- AddCommonFileType$Png: Adds PNG file type.
- AddCommonFileType$Any: Adds “any” file type.
- AddCommonFileType$Text: Adds text file type.
- AddCommonFileType$Mpeg: Adds Mpeg file type.
- AddCommonFileType$Quicktime: Adds QuickTime file type.
- AddCommonFileType$More: Adds “more” file type.
Report Layout Editor
- AddPageSection: Add page header/footer section to report.
- AddGroupSection: Add group header/footer section to report.
Copy File Steps Editor
- AddFileToCopyFilesStep: Displays file dialog to select a file to add to the editor.
- RemoveFileFromCopyStep: Removes the selected file from the editor.