Processing Ajax...
Save 25% on our desktop apps during our Black Friday/Cyber Monday sale!Save 25% on our desktop apps during our Black Friday/Cyber Monday sale, including DisplayFusion, ClipboardFusion, FileSeek, LogFusion, TrayStatus, and VoiceBot!Save 25% on our desktop apps during our Black Friday/Cyber Monday sale!

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Trying to make an action when switching to a specific Edge tab

User Image
Sullie
19 discussion posts
Hi all,

I made a trigger which, when an Edge tab is focussed and it contains say, "video games" will run an action.

This works great, but only if the browser is focussed from being unfocussed (alt+tab, for instance). Can I make DisplayFusion renew focus by switching tabs instead of switching applications?

Hopefully this makes sense.
Sep 26, 2022  • #1
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Hi Sullie,

We could create a script that loops every second and looks for a specific window title. If you think that would work, let us know and we can look into it.

Thanks!
Sep 28, 2022  • #2
User Image
Sullie
19 discussion posts
Hi Owen,

That sounds very useful. Thank you.

Would the performance still be low, similar to how the standard trigger functions work? I would like to keep my CPU cool.

Thanks,

Sullie
Sep 29, 2022  • #3
Owen Muhlethaler (BFS)'s profile on WallpaperFusion.com
Give this one a shot, you can import it via the DisplayFusion Settings > Functions > Scripted Function > Import Scripted Function.

You can adjust the window text you want it to look for on line 16, and add any actions you would like on line 18.

There shouldn't be too much of a performance hit, but you can increase the loop timer on line 21 if you would like it to happen less often.

Thanks!

Attachment deleted.
Sep 30, 2022 (modified Oct 3, 2022)  • #4
User Image
Sullie
19 discussion posts
Thank you, Owen. However, I have found the code increases DF from 0-2% CPU to 25-50%! I even turned the timer up from 1 sec to 10 sec, which seemed to make no difference.

I also couldn't get it to work. I believe I edited the settings properly and added the function in the correct space (was trying to send a test notification). However, nothing came through. I tested this with Edge, Everything.exe, and Messenger. Same results.

I also was unable to turn off the script with the hotkey I assigned to it in DF, though I was able to turn it on. I confirmed this by seeing a script icon in the Windows Tray.
Oct 3, 2022  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Owen's off today so I'll take over here. Looks like the script was missing the curly brackets for the while loop, the attached update should fix it up.

It's not possible to have a scripted function stop by pressing the hotkey as it's sometimes desirable to run multiple instances of a long running script.

Exiting the script using the tray icon is the correct way.
Oct 3, 2022  • #6
User Image
Sullie
19 discussion posts
Thank you. This works now, but still takes up a tonne of CPU. It's strange, because the everything else in DF seems to run very low CPU.
Oct 5, 2022  • #7
Keith Lammers (BFS)'s profile on WallpaperFusion.com
It doesn't seem to cause any CPU issues here when I run it. What's the DisplayFusion.exe CPU usage on your system when the script isn't running, vs. when it is running?
Oct 5, 2022  • #8
User Image
Sullie
19 discussion posts
Right now, from Task Manager, DisplayFusion.exe is at 0% for CPU in the Details tab, and flucuating between around 0-2% in the Processes tab.

When I run the script, which I downloaded again and only edited the time from 1000 to 10000, DisplayFusion.exe is at 4-5% for CPU in the Details tab, and flucuating between around 11-18% in the Processes tab.

A few other notes:

- When I manually disabled the script via tray icon, I noticed DisplayFusion is still running around at the same CPU intensity as when the script was enabled.

- I have closed down DisplayFusion and note that the CPU has returned to pre-script normal.

- I have restarted DisplayFusion and note that the CPU has returned to normal for the system and DisplayFusion. Currently reporting 1.2% In Processes and 0% in Details.

I'm using Windows 11 10.0.22622 and running DisplayFusion 10.0 (Beta 17).

While I'm in DisplayFusion writing mode. Could I please request that the following is added:

PC was off all night and gets started from boot each morning (not sleep mode).

1. A little search box on the Triggers page so I can find things quicker. The number of triggers I use has increased over the years.

2. A recorder for interacting with UI elements of Windows apps and programs. The recorder could tell when you click something in a certain program, close it's process, etc. and perhaps have some OCR/image recognition built for applications that can't be easily hooked.
Oct 7, 2022  • #9
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Could you send me a debug log captured while the script is running, and a second one while it's not running?

  • On the DisplayFusion Settings > Troubleshooting tab, change the Logging drop-down to "L1: Log Minimal" and click Apply
  • Reproduce the issue and note the time so we'll know where to check in the log file
  • Click the "Export Info to File" button on the Settings > Troubleshooting tab
  • Reply with the file attached
  • Disable debug logging after sending the log

I've added the filter box for the Triggers tab to our list, the other feature request is unfortunately outside the scope of DisplayFusion.
Oct 7, 2022  • #10
Was this helpful?  Login to Vote(-)  Login to Vote(-)