AlfredSwitchWindows
AlfredSwitchWindows copied to clipboard
Is it possible raise single window to the front?
Sometimes there are several windows for one application, now it will bring every window to the front in a big stack, it would be better to be able to bring the single selected window.
Thanks for the awesome workflow!
this might work:
on alfred_script(q)
set argv to extract_argv(q, "|||||")
set proc to item 1 of argv
set tabIndex to item 2 of argv as integer
set windowName to item 3 of argv
try
tell application "System Events"
with timeout of 0.1 seconds
tell process proc to perform action "AXRaise" of window windowName
do shell script "open -a '" & (name of my application proc) & "'"
end timeout
end tell
end try
end alfred_script
on extract_argv(source_string, new_delimiter)
set backup to AppleScript's text item delimiters
set AppleScript's text item delimiters to new_delimiter
set argv to every text item of source_string
set AppleScript's text item delimiters to backup
return argv
end extract_argv
@calfzhou Works for me, many thanks!
@kerryj89 Is it still working on Big Sur?
@kerryj89 Is it still working on Big Sur?
I am not on Big Sur, sorry.
@kerryj89 It works well on Big Sur. Thank you