my issue is a bit difficult to describe but I will try without screen recording...
Code: Select all
/* --------------------------------------------------------------------------------------
- .de language version
- clip board needs to contain the correct snippet
- save current clip board as channel header to file.
- this creates pre-saved clipboard file (overwrites !)
- has to run once to setup clip files
--------------------------------------------------------------------------------------
*/
::tsSaveHeader.de::
FileToHandle := WorkingPath . "TeamsChannelHeader_DE.clip"
if (FileExist( FileToHandle )) {
FileDelete, %FileToHandle% ;always empty file needed
}
ClipBackup := ClipboardAll
FileAppend, %ClipBackup%, %FileToHandle%
return
/* --------------------------------------------------------------------------------------
- inserts .de project header template .de version
- pre-saved Clipboard file needed !
--------------------------------------------------------------------------------------
*/
^H::
::tsChHeader.de::
InsertClipBoard(WorkingPath . "TeamsChannelHeader_DE.clip")
return
/* --------------------------------------------------------------------------------------
Function: InsertClipBoard( File )
File: path and clipboard file name. Clipboard file has to be created before
Feedback: error message if specified clipboard file does not exist
--------------------------------------------------------------------------------------
*/
InsertClipBoard( FilePathAndName ) {
if (FileExist( FilePathAndName )) {
FileRead, TempClip, *c %FilePathAndName%
File.Close()
Clipboard:= TempClip
Sleep 500
send ^v
}
else {
MsgBox, %FilePathAndName% "file not found"
}
}
MS Teams documentation does not publish any text format information. So the clipboard seems to be THE SOLUTION.
Well yes temporary.
If I save a clipboard content (formatted text; grep from TEAMS as template) to a file via AHK hot-string 'tsSaveHeader.de' this works fine. The re-use of the clipboard content via hot-string 'tsChHeader.de' works fine also.
When PC is shutdown and restarted, the insertion results in plain text only. No formatted text is inserted unless one updates the *.clip file
This effect is not related to MS TEAMS but any other application like WORD also. To me this is an indication AHK may not cause the issue but "participates"
Any idea ?
Thanks