StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
3di  
#1 Posted : Tuesday, April 23, 2019 6:06:03 AM(UTC)
3di

Rank: Member

Reputation:

Groups: Translators, Approved
Joined: 2/6/2018(UTC)
Posts: 1
Germany

Hi,

first of all i would like to thank Rob to this amazing new Tool, your effort has paid off, it's much better than it's predecessor.

As I'm migrating from the old version to the new i have to rework some scripts i made or got from the Forum.

Is it able to get those to work in the new version - sorry I'm not used in generating code.. :-)


Kill Process
acTerminateProcess(nil, gsx, gsy) --sample uses the gesture start coordinates (gsx and gsy)

Fire Script
acShellExecute("open","D:\\PreSalesVerzeichnis\\99_Zubehör\\Batchfiles\\Startmenue_Verknuepfungen\\01_Kill_.bat", "", "", 0)

Copy without Blanks
acSendKeys("^c")
acDelay(50)
local clip1 = acGetClipboardText()
clip = clip:gsub(" ", "_")
acSetClipboardText(clip)
acDisplayText("Clipboard - Copy ohne Leerzeichen mit _ ", "Calibri", 30, 192, 192, 192, 1500, gex,gey)

New Email
if handle ~= 0 then
if gIsIconic(handle) == 1 then
acRestoreWindow(handle)
end
acActivateWindow(handle, 0, 0, 0)
end
acActivateWindow(handle) --Activate Outlook
acDelay(200) --Allow time for Outlook to get application focus
acSendKeys("^n") --Send CTRL+2
acDisplayText("neue Email", "Calibri", 40, 192, 192, 192, 1500, gex,gey)


Thanks and Best Regards.

3di
Rob  
#2 Posted : Tuesday, April 23, 2019 8:13:24 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 73
United States

Thanks: 4 times
Was thanked: 12 time(s) in 7 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 Script
Code:
sp.RunProgram('D:\\PreSalesVerzeichnis\\99_Zubehör\\Batchfiles\\Startmenue_Verknuepfungen\\01_Kill_.bat', '', 'open', 'normal', true, false, false);


Copy without Blanks
Code:
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 Email
Code:
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);    
}
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.