Hi
my fav problem is an elm part for my bookmarks
to do: i need the windows GetWindowOther or the understanding how to
get it from myplaces → maincontainer → content → headerparent
time ago i made a function like that
/* BookMarkActionBlock ---
- home bm
- unload if nessesary
*/
public bool BookMarkAction(string strBookmark, string BookMarkWindow, string strOrder )
{
myGTFOElement = null;
var tempWindowOther = GetWindowOther(BookMarkWindow);
var Max0 = tempWindowOther.Region.Max0;
if ( tempWindowOther !=null)
{
try{
IUIElementText tempTest = tempWindowOther?.LabelText?.FirstOrDefault(w=> (w?.Text.RegexMatchSuccessIgnoreCase(@strBookmark, RegexOptions.IgnoreCase) ?? false));
Sanderling.MotionExecute(MouseClickWithRegionSubstituted(tempTest,RectInt.FromMinPointAndMaxPoint(new Vektor2DInt (tempTest.Region.Min0,tempTest.Region.Min1), new Vektor2DInt(tempWindowOther.Region.Max0,tempTest.Region.Max1)),BotEngine.Motor.MouseButtonIdEnum.Right));
Host.Delay(300);
var Menu = Measurement?.Menu?.FirstOrDefault();
var MenuEntry = Menu?.EntryFirstMatchingRegexPattern(strOrder, RegexOptions.IgnoreCase);
Sanderling.MouseClickLeft(MenuEntry);
myGTFOElement = tempTest;
return true;
}
catch
{
Host.Log("BookMarkAction Error");
return false;
}
}
return false;
}
static MotionParam MouseClickWithRegionSubstituted(IUIElement destination, RectInt region, MouseButtonIdEnum mouseButton, int repetitionCount = 0) =>
new MotionParam
{
MouseListWaypoint = new[] { new MotionParamMouseRegion { UIElement = destination, RegionReplacementAbsolute = region, } },
MouseButton = new[] { mouseButton },
MouseButtonRepetitionCount = repetitionCount,
};
/**---BookMarkActionBlock */
Sincerly Tea