Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
Gregory Diebold
49 discussion posts
I have created a custom function & a custom script that I would like to use together, where the script calls the function, unless there is a better option.

(see attachments)
* "Move to 2" simply uses DF built-in functionality to move the app to monitor #2.
* The goal of my script is to:
- launch the main Windows apps I use for updates.
- provide a delay for the apps to load.
- move certain apps to montor #2 while leaving my Windows Update on monitor #1.

I am using "BFS.DisplayFusion.RunFunction()" along with my "Move to 2" function. It works, but is there a more elegant way to run the app on monitor #2 in code?

I realize triggers can be set to move certain apps as I have done this; however, I have these apps triggered to run on monitor #1 currently. I only want them to run on monitor #2 within this script.
• Attachment: 2023-12-04_11-42-30.png [93,557 bytes]
2023-12-04_11-42-30.png
2023-12-04_11-42-30.png
• Attachment: m2.png [27,966 bytes]
m2.png
m2.png
Dec 4, 2023 (modified Dec 4, 2023)  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
This script provides a good example of how to launch an app and move it with BFS.Window.SetLocation: https://www.displayfusion.com/ScriptedFunctions/View/?ID=df0648f5-a75b-44fb-9e42-670eb315743a

You can replace BFS.Window.SetLocation with BFS.Window.MoveToMonitor if you want to move it to a monitor ID instead of a specific X/Y location.

Hope that helps!
Dec 4, 2023  • #2
User Image
Gregory Diebold
49 discussion posts
Thanks for the lead!

(see attachment)
A - I made modifications to my script based on your tip, 👍. The script now works how I need it to. I find the delay parameter is a trial-&-error experience since the value needed depends on the current processor load. 500 works sometimes, but 2500 is needed as the same parm under different loads.
I moved the variable pointer declaration to the top so I could reuse it for each window launched.

B - What is the main difference between .Sleep() & .ThreadWait()? They seem to have the same effect. I looked in the Help to read up on the differences, but .Sleep() must be a new function.

C - My next challenge is to position the cursor on monitor #2 over the dashed circled camera group. An extra added bonus would be to simulate a left mouse click, if possible.
• Attachment: 2023-12-05_06-46-11.png [663,987 bytes]
2023-12-05_06-46-11.png
2023-12-05_06-46-11.png
Dec 4, 2023 (modified Dec 5, 2023)  • #3
User Image
Gregory Diebold
49 discussion posts
UPDATE! I used the virtual screen coordinates of monitor #2 to position the mouse cursor and left-click. Getting the coordinates was done by using SnagIt to capture both desktops and then pasting into Gimp.

Works great!! I put the positioning code at bottom after both apps were loaded so I wouldn't need to put .Sleep() in.

Any suggestions?
• Attachment: df.png [49,106 bytes]
df.png
df.png
Dec 5, 2023  • #4
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Glad to see you got the mouse positioning and clicking working. I believe Sleep and ThreadWait do the same thing but it should be documented, I've added that to our to-do list.
Dec 5, 2023  • #5
User Image
Gregory Diebold
49 discussion posts
ThreadWait just sounds cooler, though. I added a "double-click" to maximize one of my cameras. Any suggestions on improving the code? 🖖
• Attachment: 2023-12-05_17-11-28.png [36,890 bytes]
2023-12-05_17-11-28.png
2023-12-05_17-11-28.png
Dec 5, 2023 (modified Dec 5, 2023)  • #6
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Nope, it looks pretty good to me!
Dec 6, 2023  • #7
User Image
Gregory Diebold
49 discussion posts
I'll take "pretty good", it works...

I just added this prompt box to optionally perform the double-click to maximize a single camera or just show the default group.

// Max Vinyl Bay window
if (BFS.Dialog.GetUserConfirm("Start with Brent/DJ's desk?"))
{
// BFS.Input.SetMousePosition(2100, 230); // vinyl bay
BFS.Input.SetMousePosition(2100, 828); // Brent Desk
BFS.Input.LeftClickMouse();
BFS.Input.LeftClickMouse();
}

Is there a dialog box that offers more than two options? I looked at .Dialog.GetUserInputList, but it's a dropdown. Buttons are preferable, if available.
Dec 6, 2023 (modified Dec 6, 2023)  • #8
Keith Lammers (BFS)'s profile on WallpaperFusion.com
BFS.Dialog.GetUserInputListViewWithFilter provides a multi-line list and clicking an item in it selects it.
Dec 6, 2023  • #9
User Image
Gregory Diebold
49 discussion posts
I'm using Windows 11, 10.0.22631 but do not see my jump list functions when right-clicking the DF icon.
• Attachment: 2023-12-07_09-27-35.png [37,512 bytes]
2023-12-07_09-27-35.png
2023-12-07_09-27-35.png
Dec 7, 2023  • #10
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Jump list entries show in the menu when right-clicking the taskbar button for an open window on the DisplayFusion taskbar :)
Dec 7, 2023  • #11
User Image
Gregory Diebold
49 discussion posts
Ahhh, on the 2'nd monitor only. ok, thought they both became DF Taskbars. Works fine.
• Attachment: df task.png [18,286 bytes]
df task.png
df task.png
Dec 8, 2023  • #12
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)