Hi,
I'm looking for a function to fetch the URL from a browser window / tab, where the gesture was drawn.
Depending on that URL, the action performed should be different. - So a specific website can have one gesture do other actions that the rest.
Background: We are introducing a new SAP ERP system in our company. Before, we used the SAP GUI, which is a installed prgram and you could easily create a app definition and have actions on that. New SAP is used via WebUI "Fiori" in the browser, so I'm not able to distinguish between a random website and the ERP system, unless I check on which URL the gesture is drawn.
I made up a solution, where I copy the URL from the address bar:
Initializing global variables in global load section. (Don't know if this is good style or just unnecessary...)
Code:var g_isEdgeFiori = false;
var g_SAPLang = "";
Then grab the URL in the Edge browser before automation section and set the variables accordingly
Code:sp.Sleep(10);
sp.SendModifiedVKeys([vk.LCONTROL],[vk.VK_L]);
sp.Sleep(80);
sp.SendModifiedVKeys([vk.LCONTROL],[vk.VK_C]);
sp.Sleep(10);
sp.SendVKey(vk.ESCAPE);
var l_URL = clip.GetText();
if (l_URL.includes(".sap.mycompanydomain.com:")) {
g_isEdgeFiori = true
if (l_URL.includes("sap-language=DE") || l_URL.includes("sap-language=de")) {
g_SAPLang = "DE";
} else {
g_SAPLang = "EN";
}
}
l_URL = "";
The action, for example navigate back, checks if it's Fiori (and if needed the language) and depending sends different keys
Code:if (g_isEdgeFiori) {
sp.SendVKey(vk.F3);
} else {
sp.SendVKey(vk.BROWSER_BACK);
}
Finally resetting the global variables in after action automation
Code:g_isEdgeFiori = false;
g_SAPLang = "";
This works ok, but it's not a elegant solution and it terribly spams the clipboard history (Windows 10 / 11 feature), that we heavily use.
I would need a reliable solution, that doesn't use the clipboard.
Searched for similar approaches and found a AutoHotKey script, that does what I ask for:
GetUrlTried to get behind how this works and build it in S+, but failed. - I'm not a developer, so my coding skills are pretty basic...
Calling the AHK script from S+ is not a good solution, since it should be standalone in S+, that I can forward this to co-workers without having to struggle setting up AHK along with it.
Using a separate browser for the Fiori vs. the regular websites is not possible. We are limited to Edge.
So the big questions are:
Does S+ have a implemented function to get the URL from the browser?
If not, is there a way to mimic the function of the AHK script above? - Looks like COM interfaces are used there. Can S+ do that, too?
Or is there any other way with the given parameters?
Thanks for some support here.
Best regards,
Michael