This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script = [[ | |
tell application "Safari" | |
set numWin to count of tabs of window 1 | |
if numWin > 1 then | |
close current tab of front window | |
end if | |
if numWin = 1 then | |
tell application "System Events" | |
keystroke "t" using command down | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script = [[ | |
tell application "WeChat" to activate | |
tell application "System Events" | |
tell process "WeChat" | |
key code 43 using {command down} | |
end tell | |
end tell | |
tell application "System Events" |