Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,382 ![United States United States](/Content/images/flags/US.png) Location: Tampa, FL Thanks: 28 times Was thanked: 430 time(s) in 363 post(s)
|
See below, these should all work fine. Note that you could make a display text function in your Load Scripts area, so calling it would be less code in your scripts, but put the full code in these examples. Like you could have it accept the title, message, location, font size so when you want to display text, it would only require one line of code. But if you're not constantly making actions every day, it's not a big deal. Kill Process ( Code://if using an action
action.Window.Process.Kill();
//other areas, like hot keys, this kills the foreground window
sp.ForegroundWindow().Process.Kill();
Fire ScriptCode:sp.RunProgram('D:\\PreSalesVerzeichnis\\99_Zubehör\\Batchfiles\\Startmenue_Verknuepfungen\\01_Kill_.bat', '', 'open', 'normal', true, false, false);
Copy without BlanksCode:sp.SendKeys("^c");
sp.Sleep(50);
var nospaces = clip.GetText().replace(/\s/g, '_');
if(nospaces) {
clip.SetText(nospaces);
var info = new DisplayTextInfo();
info.Title = 'Clipboard';
info.TitleAlignment = 'Center';
info.Message = 'Copy ohne Leerzeichen mit _ ';
info.MessageAlignment = 'Left';
info.Duration = 1500;
//The transparency of the popup, valid ranges: 0.05 - 1.0 (1.0 is no transparency)
info.Opacity = 1.0;
//Location supports location as well, use this format to specify a type: '100,200'
//types: topleft, top, topright, right, bottomright, bottom, bottomleft, left
info.Location = action.End.X + ',' + action.End.Y;
info.TitleFont = new Font('Calibri', 30, host.flags(FontStyle.Bold));
info.MessageFont = new Font('Calibri', 30);
info.BackColor = '192,192,192';//'56,169,255'; //Also supports RGBinfo.ForeColor = 'white';
info.Padding = 15;
//If true, always displays on primary screen (unless Location is a point type),
//otherwise displays on the screen where the gesture started
//info.UsePrimaryScreen = true;
sp.DisplayText(info);
}
New EmailCode:var outlookWindows = sp.AllApplications().Where(a => a.Process.MainModule.FileName.includes("OUTLOOK.EXE"));
if(outlookWindows) {
var outlookMainWindow = sp.WindowFromHandle(outlookWindows.First().Process.MainWindowHandle);
outlookMainWindow.Activate();
sp.Sleep(200);
sp.SendKeys("^n");
var info = new DisplayTextInfo();
info.Title = 'Outlook';
info.TitleAlignment = 'Center';
info.Message = 'neue Email';
info.MessageAlignment = 'Left';
info.Duration = 1500;
//The transparency of the popup, valid ranges: 0.05 - 1.0 (1.0 is no transparency)
info.Opacity = 1.0;
//Location supports location as well, use this format to specify a type: '100,200'
//types: topleft, top, topright, right, bottomright, bottom, bottomleft, left
info.Location = action.End.X + ',' + action.End.Y;
info.TitleFont = new Font('Calibri', 40, host.flags(FontStyle.Bold));
info.MessageFont = new Font('Calibri', 40);
info.BackColor = '192,192,192';//'56,169,255'; //Also supports RGBinfo.ForeColor = 'white';
info.Padding = 15;
//If true, always displays on primary screen (unless Location is a point type),
//otherwise displays on the screen where the gesture started
//info.UsePrimaryScreen = true;
sp.DisplayText(info);
}
|