Title

Message

Confirm

<< DiscussionsReply

Function with dependency based on monitor profile

Avatar from Gravatar.com
Sorrylol
34 discussion posts
Hey there, I was wondering if anyone knew of a way to create a function that basically when executed acts as: if monitor profile 1 = true, then do ‘x’ action, if monitor profile 2 = true, then do ‘y’ action, if monitor profile 3 = true, then do ‘z’ action’. Basically, one function that depending on which monitor profile I am in, executes a certain command. For example, if current monitor profile = ‘1920’ then execute windows position profile entitled ‘1920x’, or if current monitor profile = ‘5760’ then with the same function, execute windows position profile entitled ‘5760’. Also is there any way to run another function, through this? For example, if current monitor profile = ‘1920’, then run “abc” custom function, or if current monitor profile = ‘5760’, then run ‘def’ custom function. Any input regarding this would be much appreciated, just thought of this as a way to cut down on hotkeys, instead of having like 3 or 4 depending on which monitor profile I am currently in, if it were possible to consolidate it all into one function with one hotkey that acts accordingly depending on which profile I am currently in.
13 days ago  • #1
Avatar from Gravatar.com
Sorrylol
34 discussion posts
or instead of having it based off of current monitor profile, does anyone know of a way to reference the primary display/monitor resolution somehow? so if primary display resolution = "1920x1080" do 'x' function, or if primary display resolution = "1440x1080" do 'y' function
12 days ago  • #2
Keith Lammers (BFS)'s profile on WallpaperFusion.com
You can do this with a Scripted Function. Here's some sample code to get you started:

Code



Hope that helps!
12 days ago (modified 12 days ago)  • #3
Avatar from Gravatar.com
Sorrylol
34 discussion posts
Hello Keith, thank you for the reply, I just tried the code, and I get an error when trying to specify the current monitor profile, "Cannot implicitly convert type 'string' to 'bool'", any idea on how to fix this possibly? thanks again tremendously.
12 days ago  • #4
Avatar from Gravatar.com
Sorrylol
34 discussion posts
turns out it needed 2 equal signs like this to work, "(currentMonitorProfile == "1920")".

thank again! works great.
12 days ago  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ah yep! I made a rookie mistake! I've updated my post with that change as well. Glad to hear it worked osition:relative;vertical-align:middle;">
12 days ago  • #6
Was this helpful?  (1)  
<< DiscussionsReply