您好,欢迎来到尚车旅游网。
搜索
您的当前位置:首页UltraEdit的宏命令

UltraEdit的宏命令

来源:尚车旅游网
UltraEdit的宏命令

The Edit Macro command allows a new macro to be created and edited or an existing macro that has previously been generated with this command or with the Macro Record command to be edited.

In many cases, it is easier for the user to generate the macro by recording it with the Macro Record command and then to edit it if necessary. The learning curve is less with this approach.

Commands

A macro is a series of commands that may later be played back automatically to modify the file. The left hand side of the dialog shows the current macro being edited and an editable window containing the commands that make up the macro.

The commands in the macro must be one of the predefined commands. These predefined commands are shown on the right hand side of the dialog. If the mouse is double clicked on the command it is automatically added to the macro, or clicking on the arrow to the left of the commands will add it to the macro.

Parameters

Many of the commands have numeric parameters. The numeric parameters are quite obvious, such as \"Goto Line #\" or \"Goto Page #\". However, some of the commands such as Find and Replace, Sort etc. have additional parameters that are not numeric. These additional parameters are listed below the command list for easy selection.

Creating a New Macro

To create a new macro from this dialog click the New/Macro button. This displays the Macro Definition dialog allowing you to define the macro name and hot key if required.

When this new macro is created, three macro commands are automatically added to the macro:

- Insert Mode or OverStrike Mode

- ColumnModeOn or ColumnMode Off

- HexOn or HexOff

These three commands are added based on the current state of the editor. The purpose is to establish a known state each time the macro is played. If a macro is recorded in one mode and played back in another the results may be unpredictable. Establishing the mode at the beginning of the macro helps to ensure the expected results are achieved. These commands may be modified as required.

Once an edit macro has been created, it may be edited.

Modifying The Macro

To modify the macro, commands may be typed directly into the macro edit box or selected from the command list. Commands are not case sensitive but must be spelled exactly as shown in the command list.

The table below shows the commands that may be added to any parameters:

Commands Parameters* Description \"\" Insert text between the quotes (\"\"). The closing quote must be the last non-space character on the line. The characters to be inserted may cross multiple lines. To insert a quote (\"), place it as needed in the text being inserted and ensure the last character is also a quote. To insert just one quote character (\") the line should look like this: \"\"\" To insert a new line, add a line between the open quote and close quote. To insert two lines with 1 and 2 at the beginning of the lines the command should be as follows: \"1 2\" AnsiToOem Bottom CloseFile Convert file from ANSI to OEM. Jump to end of file. Close the active file. Blank (no parameter),Save - forces the file to be saved before closing NoSave - closes the file without prompting if the file should first be saved ClearClipboard Clear the contents of the active clipboard within UltraEdit. Clipboard Clipboard number (0-9) Select the specified clipboard - 0 = Windows Clipboard and 1-9 specifies user clipboards. ColumnCenterJustify ColumnLeftJustify ColumnRightJustify ColumnModeOff ColumnModeOn ColumnCut ColumnDelete Center justify selected columns. Left justify selected columns. Right justify selected columns. Turn the column mode off. Turn the column mode on. Cut selected columns in column mode. Delete selected columns in column mode. ColumnInsert String in quotes (\"\") Insert string between quotes into selected columns. ColumnInsertNum start numberincrementLeadingZero (optionally) Insert number in selected columns. Copy CopyAppend Copy selected text to the clipboard. Copy selected text and append it to the clipboard. CopyFilePath Copy the active file path/name to the clipboard. Cut Cut the selected text from the file to the clipboard. CutAppend Cut the selected text from the file and append it to the clipboard. Delete DeleteLine Delete current character or selected text. Delete the current line. DeleteToEndofLine Delete from the current cursor position to the end of the line. DeleteToStartofLine Delete from the current cursor position to the start of the line. DosToMac Convert the file (line terminators) to MAC format. DosToUnix Convert the file (line terminators) to UNIX format. Else Else function for an IF... command. IfSel ... Else do these commands if the IfSel failed. Endif EndIf Ends the block of instructions controlled by the IfFound/IfNotFound statements. EndLoop End of loop - go back to beginning of the loop - see the Loop command. EndSelect Stop Selecting Text (see Start Select for details). ExitLoop Exit loop and go to first command after the loop (after the EndLoop command) - see the Loop command. ExitMacro Exit Macro without processing any additional commands or returning an error. Find \"\" (Search string in quotes) MatchCase - indicates the search is case sensitive (optional) MatchWord - indicates the search string will only match instances that are a complete word (optional)RegExp - Indicates a Regular Expression search (optional) RegExp - Indicates a Regular Expression search (optional) Up - Indicates search in reverse direction (optional) Select - Indicates the text should be Find the string in quotes \"\" based on the parameters specified. selected from the current selection/position to the end of the search target. FromEBCDIC GetString Convert text from EBCDIC format. Prompts the user for a string that is inserted in the file at the current location. The \"prompt\" is the prompt or question that is displayed to the user when the macro is run. String in quotes (\"\") used in the prompt dialog GetValue String in quotes (\"\") used in prompt dialog Prompts the user for a value that is inserted in the file at the current location. The \"prompt\" is the prompt or question that is displayed to the user when the macro is run. GetValue \"How old are you? \" GotoBookMark GotoBookMarkSelect Jump to the next bookmark. Jump to the next bookmark and select text from cursor position to bookmark. GotoLine GotoLineSelect Numeric value of line number to jump Numeric value of line number to jump Jump to specified line number. Jump to specified line number and select text from cursor position to line. GotoPage GotoPageSelect Numeric value of page to jump Numeric value of page to jump Jump to specified page number. Jump to specified page number and select text from cursor position to page number. HexDelete Numeric value specifying number of bytes to delete Delete the specified number of bytes from the file. Insert the specified number of bytes into the file. Turn Hex mode off - switch to text mode. Turn Hex mode on. Hide the selected lines, or if hidden, show the lines hidden at the line of the cursor. HexInsert Numeric value specifying number of bytes to insert HexOff HexOn HideOrShowLines IfCharGt \"character\" or number. This checks if the current character at the cursor position is greater than the specified character or number specified. The check against a number is not to check the value of a string but the value of the underlying character. IfCharGt \" \" ... do these commands if the current character is greater than a space. ... EndIf IfCharIs 32 ... do these commands if the current character's decimal value is greater than 32 - a space. ... EndIf IfCharIs \"string\" or number. This checks if the current character at the cursor position is in the specified string, or matches the decimal number. IfCharIs \"xyz\" ... do these commands if the current character is x, y, or z. ... EndIf IfCharIs 34 ... do these commands if the current character is decimal value 34 - a double quote. ... EndIf IfColNum number. This checks if the current cursor position is the specific column number. IfColNum 10 ... do these commands if the current cursor position is column 10. Column 1 is the first column. ... EndIf IfEof This checks if the current cursor position is at the end of file. IfEof ... do these commands if at end of file ... EndIf IfExtIs \"string\". This checks if the file extension of the active file matches the specified string. If the extension matches, the condition is satisfied and the macro will execute the steps following the IfextIs statement. IfExtIs \"txt\" ... do these commands if the current file extension is txt. ... EndIf IfFound IfFound This checks the results from the last find command in the macro and will execute the next set of instructions up to an \"EndIf\" if the last search was successful: Find \"something\" IfFound ... do these commands if \"something\" was found ... EndIf NOTE - To avoid a \"Not Found\" message when running the macro, make sure the \"Continue if a Find with Replace Not Found\" check box is set for the macro properties. IfFTP This checks if the current file is a file loaded via FTP/SFTP and not a local/network file. IfFTP ... do these commands if the file is an FTP loaded file ... EndIf IfNameIs \"string\" This checks if the active filename (not path or extension) matches the specified string. If the name matches, the condition is satisfied and the macro will execute the steps following the IfNameIs statement. IfNameIs \"test\" ... do these commands if the current filename is test (irrespective of the file extension). ... EndIf IfNotFound This checks the results from the last find command in the macro and will execute the next set of instructions up to an \"EndIf\" if the last search was NOT successful: Find \"something\" IfNotFound ... do these commands if \"something\" was NOT found ... EndIf NOTE - To avoid a \"Not Found\" message when running the macro, make sure the \"Continue if a Find with Replace Not Found\" check box is set for the macro properties. IfSel This checks if there is currently any selected text within the active file. IfSel ... do these commands if \"something\" is selected ... EndIf InsertMode Change text editing mode to insert mode for characters typed. InsertPageBreak Insert a form feed/page break character at the current cursor position in the file. InvertCase Loop Invert the case of selected text. Loop x times where x is a number. A value of 0 indicates Loop forever. i.e. x Loop 10 ... do these commands 10 times ... EndLoop Key Backspace Ctrl+ DEL DOWN ARROW END HOME LEFT ARROW PGDN PGUP RIGHT ARROW UP ARROW MatchBrace Insert a key command into the macro. Generally used for navigation in the file and for backspace or delete. The \"Ctrl+\" modifier may be used as with normal editing to modify the command. For text input the \"\" string command is used, not the Key command. Find matching brace and select the text between them. NextDocument NextWindow NewFile OemToAnsi Open Switch to next file tab document. Switch to next window. Open a new blank file. Convert file from OEM to ANSI. Open the specified file. The Filename must be in quotes. \"^s\" may be used in the filename. UltraEdit will replace this with the currently selected text in the active Window. Likewise, \"^c\" may be used and UltraEdit will replace this with the contents of the clipboard. Filename in quotes (\"\") OverStrikeMode Change text editing mode to overstrike mode for characters typed. Paste Paste the contents of the clipboard into the file. PlayMacro Numeric value specifying number of times to play it Macro name (\"\") in quotes. Play another macro. Specify the number of times to play the macro first, then the macro name. The macro name must be in quotes. PreviousBookMark PreviousBookmarkSelect Jump to the previous bookmark. Jump to the previous bookmark and select text from cursor position to bookmark. PreviousDocument PreviousWindow Replace Switch to previous file tab document. Switch to previous window. The Replace command replaces the previously found string with the string specified. This command MUST follow a Find command.As with the Find string, the replace string must be in quotes. The closing quote must be the last non-space character on the line. The replace string may cross multiple lines however, if the last non-space character in any line is a quote it will terminate the string. All special characters permitted by the Replace Command are permitted here. All - Replace all occurrences. AllFiles - Replace in all open files (requires All). Selected Text - Replace in selected text (Requires All). Replace String in quotes (\"\") - String to replace the found string. ReturnToWrap RunTool Convert hard returns to word wrap. String in quotes (\"\") specifying the menu Run a tool. The tool must be configured name of tool to run from Tool Configuration in the Advanced menu. Save SaveAll SaveAs Save active file. Save all open files. Save the active file as the filename specified. The Filename must be in quotes. \"^s\" may be used in the filename. UltraEdit will replace this with the currently selected text in the active Window. Likewise, \"^c\" may be used and UltraEdit will replace this with the contents of the clipboard. Filename in quotes (\"\") SelectAll SelectLine Select all text in the file. Select the line the cursor is on, including the hard return at the end of line. SelectToBottom Select all text from the current position to the end of file. SelectToTop Select all text from the current position to the top of file. SelectWord Select the current word (same as double clicking a word). SortAsc IgnoreCase - Ignore case of characters in the sort. RemoveDup - Remove duplicate lines. Numeric - Sort based on numeric value, not character order Pairs of sort keys (numeric values), each value is separated by a space. Sort the file, or selected text in ascending order. SortDes IgnoreCase - Ignore case of characters in the sort. RemoveDup - Remove duplicate lines. Numeric - Sort based on numeric value, not character order Pairs of sort keys (numeric values), each value is separated by a space. Sort the file, or selected text in descending order. SpacesToTabs Convert (leading) spaces within the file to tabs. SpacesToTabsAll Convert (all) spaces within the file to tabs. StartSelect Start selection. This turns the selection mode on. Any cursor movement or positioning will be with selection on and the text is selected. EndSelect will stop the selection mode. The selected text will remain selected until another command causes it not to be selected as with normal editing. TabsToSpaces Template TimeDate Convert all tabs within the file to spaces. Insert the specified template into the file. Insert the time and date into the file at the current location. Template Number (#) ToCaps ToEBCDIC ToggleBookMark Capitalize each word in the selected text. Convert text to EBCDIC format. Set or remove a bookmark at the current line. ToLower Top ToUpper TrimTrailingSpaces Convert the selected text to lower case. Jump to top of file. Convert the selected text to upper case. Trim trailing spaces from each line of current file. UnixMactoDos Convert the active file (line terminators) from Mac/Unix to DOS format. UnixReOff Switch regular expressions to UltraEdit style regular expressions (not Unix). UnixReOn Switch regular expressions to Unix style regular expressions. WrapToReturn Column number (#) at which wrap is performed. Zero for the column number indicates the wrap is to occur at the window boundary. Convert the file from word wrap to hard returns. * Where (#) exists in the parameter column a numeric value is to be entered for that parameter. Likewise, where (\"\") exists in the parameter column a stringis to be entered between quotes. The text only describes the meaning of the parameter. All string parameters must be the last parameter.

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- sceh.cn 版权所有

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务