Update export-scripts2serenade.ps1

This commit is contained in:
Markus Fleschutz 2021-10-10 10:13:53 +02:00
parent 989ddd6a38
commit 1e20cb74ce

View File

@ -24,11 +24,12 @@ try {
"/* Exported by export-scripts2serenade.ps1 */" > $TargetFile "/* Exported by export-scripts2serenade.ps1 */" > $TargetFile
foreach ($Script in $Scripts) { foreach ($Script in $Scripts) {
$ScriptName = $Script.basename $ScriptName = $Script.basename
$Keyword = $ScriptName -replace "-"," "
"" >> $TargetFile "" >> $TargetFile
"serenade.global().command(\"$ScriptName\", async (api) => {" >> $TargetFile "serenade.global().command(`"$Keyword`", async (api) => {" >> $TargetFile
"await api.focusOrLaunchApplication(\"terminal\");" >> $TargetFile "await api.focusOrLaunchApplication(`"terminal`");" >> $TargetFile
"await api.typeText(\"$Script\");" >> $TargetFile "await api.typeText(`"$ScriptName.ps1`");" >> $TargetFile
"await api.pressKey(\"return\");" >> $TargetFile "await api.pressKey(`"return`");" >> $TargetFile
"});" >> $TargetFile "});" >> $TargetFile
} }