Functionname: Type
Decription: Type is for typing text or executing commands. Type will hold the focus of the current window while typing.
Parameter list:
- [Text] - The first parameter contains the text that needs to be typed.
- [cpm] - is the typing speed in Characters Per Minute. The default is 300.
- [hideInLogging] - is an option to replace the typed text with asterisks in the logging. This is set to true by default for security reasons.
Variable options:
- ApplicationPassword - using this variable you can enter an encrypted password for a specific application. More info found in the Login PI 3 - Application Password Encryption article.
- ApplicationUser - using this variable you can enter an encrypted user for a specific application. More info found in the Login PI 3 - Application Password Encryption article.
Examples
// This will type normal text
Type("Insert text here",cpm:300);
// This will execute an ENTER command.
Type("{ENTER}");
// This will execute an ENTER command twice.
Type("{ENTER}".Repeat(2));
// Backslash is an escape character. Commonly used in typing paths.
Type("C:\\Folder\\Folder1\\something.txt");
// You can also accomplish this by entering a @ sign in front of you text.
Type(@"C:\Folder\Folder1\something.txt");
// Typing to a window variable will keep the focus on that window
MainWindow.Type("Insert text here");
KeyDown(KeyCode.SHIFT); // Holds the SHIFT key
Type("insert non-capital text here"); // This text will be typed in uppercase
KeyUp(KeyCode.SHIFT); // Releases the SHIFT key
Type("insert non-capital text here"); // This text will be typed in lowercase
Comments
0 comments
Please sign in to leave a comment.