tdalon / ahk Goto Github PK
View Code? Open in Web Editor NEWRepository for AutoHotkey scripts including PowerTools
License: MIT License
Repository for AutoHotkey scripts including PowerTools
License: MIT License
Teams.ahk, Line 1 is "#Include "
Looks like People.ahk is missing from the repo
Error at line 1 in #include file
"C:\Users--------\Repos\tdalon_ahk\Lib\Teams.ahk".Line Text: #Include <People>
Error: Function library not found.The program will exit.
Currently, whenever we minimize the meeting window, it becomes a box in the bottom-right of one's screen.
Teams has no way to disable this feature currently.
Is it possible to add a parameter to Teams_GetMeetingWindow to attempt to expand any minimized Teams meeting windows before attempting to get the meeting window ID?
I could then set that to enabled in my shortcuts and not have to manually click expand every time.
I am generally using a headset with a Poly Headset with BT700 adapter. When I switch off the headset, teams complain my mic is not working, but does not switch to another device such as the built-in mic and speakers.
Is it possible to add a shortcut to select a predefined set of audio devices?
Hi, copying from Teams often includes unselected metadata (username and timestamp) and I would like to remove this.
I see AHK can modify clipboard contents (https://www.autohotkey.com/board/topic/61302-modify-clipboard-contents/) so I'm wondering if you have had any experience trying to use this to get Teams clipboard copy to behave as "old" computer users expect (i.e. copy only what is selected).
I will try this myself after more research, but don't want to go down a road that is fruitless if others know as much.
Thanks!
Hello. Creating an issue here as requested here. I was previously able to use the script below to mute/unmute Teams v1 meetings . The script was/is convenient as no other libraries, tools, or extra scripts were necessary. With the release of the new Teams v2, the script no longer works.
Pause::
; Get IDs for all teams windows
WinGet, id, list, ahk_exe Teams.exe
; Loop through IDs of all teams windows
Loop, %id%
{
this_ID := id%A_Index%
; Get the title of the current window
WinGetTitle, Title, ahk_id %this_ID%
; Make sure title is not the notification
if Title <> Microsoft Teams Notification
{
; Screen sharing win uses null title, make sure the win does not have a null title
if Title <>
{
; This should be the correct win, activate it
WinActivate, ahk_id %this_ID%
; Send Ctrl Shift M shortcut
Send, ^M
; There are two teams windows, the main win and the meeting win, break the loop so that the mute commmand doesnt get sent twice
break
}
}
}
Just came across this project yesterday and I have to say, I'm thoroughly impressed. Thanks for your hard work, it's already making my life easier!
After using the app for a while, I have one request: in TeamsShortcuts could you add a shortcut to switch focus to the current meeting without taking any other action? It'd be really handy when I'm working on other things during a meeting so I don't have to dig through a bunch of windows to see the window when someone starts presenting something.
Thanks!
No active Teams meeting window found
This is the error I get when I try to mute Teams from the F12 key I have mapped to.
I downloaded what I believe to be the latest TeamsShortcuts.exe from here: https://github.com/tdalon/ahk/tree/main/PowerTools
I'm running MS Teams version: 1.6.00.29964 (64-bit). It was last updated on 11/4/2023.
I also have v2 installed but using the above 'classic' version.
Running latest Teams Shortcuts, assigned F12 shortcut to Mute but nothing happens. I can check the logs but I don't know where it logs to.
Running Teams classic (Microsoft Teams Version 1.7.00.10152 (64-bit). It was last updated on 5/1/2024.) on Windows 10
I'd like to automate a few very frequent clicks in Teams.
I find myself clicking a meeting's Join button (either on my calendar or via the tray notification) to open the pre-meeting Join menu.
After this menu pops up I usually click Join (or sometimes the Transfer button to transfer from a different device).
After joining the meeting I always do the same thing:
Do we have a function for step #2 or are those actions are unreachable? It would also be great to have some function to check if the active teams window is already focused (returning true or false).
Hi,
i want to use the ahk Repository for the using Teams-Functions. I can´t use it with the .exe because my managed client doesn´t support it.
Is it possible to share the math Library used in the Encyption.ahk.
Regards
Christian
Currently, when doing Teams's Copy Image action, it puts text in the clipboard instead similar to:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAi4AAAFqCAYAAAA9a9E4AAAgAElEQVR4nOydd3xUVfr...">
Apparently, this is for security reasons:
https://learn.microsoft.com/en-us/answers/questions/857548/images-copied-from-chat-is-not-copied-to-clipboard
It hasn't received much upvotes on the portal...
https://feedbackportal.microsoft.com/feedback/idea/0c420a9b-ae9a-ed11-a81b-000d3a0450e3
Looks like they won't fix it and most people are just downloading in order to copy paste across apps.
Is it possible to add a function to Teamsy.ahk that could convert what's in the clipboard to a paste-able image?
I could then clipboard copy and then have a hotkey that calls the function... and then finally paste normally.
I put some of the files from your library that I like to use (Teams.ahk) in a generic lib folder stored on my OneDrive for convenience.
When I run a script that needs to use the Teams functions, I declare the following at the top of the script:
#Include ..\lib
#Include Teams.ahk
However, this fails because the Teams.ahk is referencing other lib files that are next to it as a library using <>
#Include <People>
#Include <UriDecode>
#Include <Teamsy>
#Include <Clip>
#Include <FindText>
#Include <UIA_Interface>
I have to thus change the Teams.ahk (includes within includes) to do a direct include like:
#Include People.ahk
#Include UriDecode.ahk
#Include Teamsy.ahk
#Include Clip.ahk
#Include FindText.ahk
#Include UIA_Interface.ahk
This would suck in case of your future updates. Otherwise I have to move the library to the MyDocuments library folder (not-synced) or do symlinks.
Anyway, hopefully you can just change these to direct references, otherwise I am not understanding why it is more valuable to do it this way (I am kind of new).
I'm sorry for commenting on a closed issue. I noticed that when the user have both versions installed and go back to the Classic version, the code fails. I made a quick patch to get it working, not a work of art, but this is the function I changed:
Teams_IsNew(){
static IsNew
If !(IsNew = "")
return IsNew
Process, Exist, Teams.exe
If (!ErrorLevel= 0) { ;Classic Teams
return IsNew
}
Else{ ;Teams v2
IsNew:= 1
}
return IsNew
} ;eofun
It checks if a process named "Teams.exe" is running as a process on your computer, if yes that's Classic, if not that's v2.
Not much thought went into whether checking for ms-teams.exe would be a better approach, or if this is a resource heavy operation and another approach would be "lighter"...
Hi,
is it possible to get Teamsy working with the german Teams Client?
Hi, as many other it seems, I came here for the mute-button. Appreciate the great work you have laid down on this one!
So I copied "Teams_Mute" and assigned the function to a shortcut instead. I copied the necessary extensions, converted it into an executable I now run on Windows startup. This works fine for "English Teams".
So now my remaining task is to make the code work for 2 languages. But my coding skills isn't as good as yours.
I'm not asking you to rewrite all the code on my behalf, but it would be helpful if you gave me some pointers?
My first error is "Could not find Meeting Window! , No active Teams meeting window found!", which I'm guessing comes from the function Teams_GetMeetingWindow.
The only language sensitive code there runs just if Maximize:=true?
And the specific text it is looking for is "Navigate back to call window.". I can't seem to find where I should look for the translated version of this text. Can't find that button.
But next I guess I should change
El := TeamsEl.FindFirstByNameAndType("Mute", "button",,2)
and
El := TeamsEl.FindFirstByNameAndType("Unmute", "button",,2)
I tried changing "Mute" to "Demp" which is the Norwegian equivalent, but that wasn't enough it seems. So I guess more changes are needed.
But since I want to support 2 languages in the same code, I was hoping you had some pointers for me on how to code this?
The way of least resistance would be to make a new "FindFirstByNameAndType"-search if the first one returns empty. But I don't know how to structure the variable or code for this.
I guess the other way to do it is to check for the locale code and replace "Mute" with varMute and assign the correct string for varMute based on the discovered locale code. But then you probably have to implement a getLang function...That's outside my knowledge.
So long story short, could you help me on my way making the functions support at least 2 languages?
Hi, I appreciate your great works.
I'd like to use NWS.exe to get URL from OneDrive/ SharePoint file sync location. So I tried to copy and "IntelliPaste" a file from sync location, but it did not work. I need your help to find the cause.
More information is written below. I'm sorry for my poor English.
IntteliCopy(Ctrl + Shift + V in browser) worked well.
When I tried to refresh SPSync.ini(Menu > Stting > IntelliPaste), the following error window popped out.
Specifically: The specified file cannot be found.
When I tried to check for update, the following error window popped out.
Specifically: This version of "%1" is incompatible with the version of Windows you are running. Please check your computer's system information and then contact the software publisher.
My computer's system information
I suspect my computer's Japanese enviroment causes the problems. So I tried to compile NWS.exe myself from the source files to find out more about it, but I ran into another problem that nonexistent function "R4J_IsUrl" is called in Jira.ahk.
Thanks
When running "Mute" (not "Mute App") in TeamsShortcuts an empty MsgBox pops up that pauses the script until OK is clicked.
Hi Thierry,
you linked me to your ahk suite a while ago and I am currently trying to get it up and running. Could you provide some documentation on how to set it up and how to use it?
I was trying to get the entire suite to run, but ahk always finds some "FunctionLibrary not found" error. I also tried to extract some parts, that I need (mute, video on/off, raise hand) but cannot get the PowerTools Suite working.
Anyway, some words about the entire framework would be awesome! Thanks
After adding another Button to IsMeetingWindow(TeamsEl,Active:= true)
if (TeamsEl.FindFirstBy("AutomationId=meeting-apps-add-btn") or TeamsEl.FindFirstBy("AutomationId=hangup-btn") or TeamsEl.FindFirstBy("AutomationID=microphone-button"))
my mute-shortcut works almost all the time. On calls and meetings.
But in a single cirqumstance, the window to mute cannot be found: Sharing a screen puts the main meeting-window in the background and an overlay window appears in the corner. This will not be found, even if it has a mute or hangup button. I guess due to a missing windows-title:
What works is clicking on this tiny overlaied windows and get the original meeting window back on the screen.
I´ve tried to use "Window Spy", which didn´t helped me at all :(
My current AHK script:
; -------------------------------------------------------------------------------------------------------------------
Teams_GetMeetingWindow(Mode :=0, Activate:=false){
; Syntax: hwnd := Teams_GetMeetingWindow(Mode:=0)
; UIAEl := Teams_GetMeetingWindow(Mode:=1|2,Activate:=true|false*)
; If window is not found, hwnd is empty
; Mode=1: return Call in progress Share window
; Mode=2 return Meeting window even if Call in progress Share Window
; See implementation explanations here:
; https://tdalon.blogspot.com/2022/07/ahk-get-teams-meeting-win.html
UIA := UIA_Interface()
WinGet, Win, List, ahk_exe Teams.exe
Loop %Win% {
WinId := Win%A_Index%
TeamsEl := UIA.ElementFromHandle(WinId)
If IsMeetingWindow(TeamsEl) {
if (Mode = 0)
return WinId
Else
return TeamsEl
}
If RegExMatch(TeamsEl.Name,"Microsoft Teams Call in progress.*") {
If (Mode =1) {
if Activate
WinActivate, ahk_id %WinId%
return TeamsEl
}
Else If (Mode = 2) {
El:= TeamsEl.FindFirstByNameAndType("Call is in progress", "text", , 1) ; partial match
If El {
El.Click()
Sleep 500
TeamsEl := Teams_FindMeetingWindow(Activate)
return TeamsEl
}
}
}
;MsgBox % TeamsEl.DumpAll()
} ; End Loop
TrayTip, Could not find Meeting Window! , No unminmized active Teams meeting window!.,,0x2
} ; eofun
; -------------------------------------------------------------------------------------------------------------------
Teams_FindMeetingWindow(Activate:= false) {
; Loop through Teams.exe Window to find Meeting Window
; Try multiple times untill it is found
UIA := UIA_Interface()
Loop, 3 {
WinGet, Win, List, ahk_exe Teams.exe
Loop %Win% {
WinId := Win%A_Index%
TeamsEl := UIA.ElementFromHandle(WinId)
If IsMeetingWindow(TeamsEl) {
if Activate
WinActivate, ahk_id %WinId%
return TeamsEl
}
}
Sleep 500
}
TrayTip, Could not find Meeting Window! , No unminmized active Teams meeting window!.,,0x2
} ; eofun
; ---------------------------------------------------------
IsMeetingWindow(TeamsEl,Active:= true){
if (TeamsEl.FindFirstBy("AutomationId=meeting-apps-add-btn") or TeamsEl.FindFirstBy("AutomationId=hangup-btn") or TeamsEl.FindFirstBy("AutomationID=microphone-button"))
if (Active)
return !TeamsEl.FindFirstByName("Resume") ; Exclude On-hold meetings with Resume button
return false
} ; eofun
; MICROSOFT TEAMS - Toggle Mute
+^!M::
WinGet, PrevWinId, ID, A ; Save the current window ID
WinId := Teams_GetMeetingWindow()
if (WinId <> "")
{
WinActivate, ahk_id %WinId%
SendInput ^+m ; toggle mute Ctl+Shift+m
Sleep 200
WinActivate ahk_id %PrevWinId% ; Restore previous window focus
}
;else
; MsgBox, 1: WinIdValue (%WinId%)
It would be great to enhance the script to find this little window. Or give me an advice how to find out the window-title and/or button name.
Thanks a lot in advance!
I would like to just use the library part of your ahk package, such as Teams_Mute()
. I've placed the contents tdalon/ahk/Lib into documents/autohotkey/lib and then tried this simple script with AHK v1:
#SingleInstance Force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#Include <Teams>
#^!M:: ; (un)mute MS Teams
Teams_Mute()
Double-clicking and loading this simple AHK script then fails with Error in #include file, with non-existent function Login_SetPassword()
. How can I fix this?
Everything seems to have been removed last week, is everything okay? I was hoping to peek at your PowerTools stuff...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.