首页 > 其他分享 >Apple script to show or hide window

Apple script to show or hide window

时间:2023-08-31 19:22:17浏览次数:45  
标签:set hide show process iTerm2 application window tell

https://apple.stackexchange.com/questions/98123/what-is-the-applescript-command-to-show-or-hide-iterm2-window

Here are several options (none of them have been tested, so test and see which one works for you):

Option 1:

tell application "iTerm2" to activate
tell application "System Events" to tell process "iTerm2" to keystroke "h" using command down

Note: Keystroke may be replaced with m if you want iTerm2 to be minimized to the dock with the Genie effect.

Option 2:

tell application "Finder"
set visible of process "iTerm2" to false
end tell 

Option 3:

tell application "System Events" to tell process "iTerm2" to set visible to false

Note: The process name may just be iTerm instead of iTerm2.
I opened iTerm on my Mac and then Activity Monitor,
and the Process Name that it shows is iTerm.
Please change accordingly if it does not work for you.

If you make the iTerm window the frontmost application
(Be careful you don't want to make the AppleScript window the frontmost application), try this script:

tell application "System Events"
    set frontProcess to first process whose frontmost is true
    set visible of frontProcess to false
end tell

标签:set,hide,show,process,iTerm2,application,window,tell
From: https://www.cnblogs.com/Searchor/p/17670267.html

相关文章

  • Mysql主从复制(一主一从)+Mycat(windows-1.X版本)实现读写分离
    项目中,如果数据量大的情况下,可以使用【数据库主从复制+读写分离】的方式优化,其他方式也很多,这里只记录下这种方式一、说明1.需要的环境等:序号环境说明1mysql5.7服务器两台数据库服务器,一台作为主数据库,一台作为从数据库2jdk安装mycat的时候会用到jdk3my......
  • CTFSHOW_你会异或吗
    Python文件操作python安装(vscode)在VSCode中选择Python解释器的方法vscodesettings.json设置file=open("misc5.png","rb")content=file.read()withopen("flag.png","wb")asa:forcontentsincontent:a.write(bytes([c......
  • CTFSHOW_web1
    PHPintval()函数wp1wp2intval()函数和mysqllimit用法......
  • svchost.exe占用内存过高--(windows update检查更新时一直处于正在检查)
    1.打开任务管理器-进程,找到svchost对应占用内存过高对应PID值例如:60982.打开任务管理器-服务,查找PID为6098的服务,如果是windowsupdate引起的则操作以下步骤 1)右击windowsupdate-属性设为停止 2)C:\windows\softwaredistribution删除里面......
  • CTFshow misc11-20
    misc11:没有头绪,看了网上大佬的一些思路,受益匪浅,和大家分享下。1.解压zip文件,用winhex打开misc11.png2.判断文件格式是否篡改,检查png的文件头和文件尾,文件格式正常PNG文件头(hex):89504e470d0a1a0aPNG文件尾(hex):0000000049454E44AE4260823.判断否有文件......
  • java directoryAndfileHide
    javaimportjava.io.File;importjava.util.Scanner;importjava.io.IOException;importjava.nio.file.Files;importjava.nio.file.attribute.DosFileAttributeView;importjava.nio.file.attribute.DosFileAttributes;publicclassDirectoryandFileHIde{pub......
  • CTFSHOW_杂项11
    【隐写工具】【试一试?】jphideseek(JPHS)使用方法,检测提示放进JPHS,无密码seek保存为.txt格式文件头有点像png,将后缀改为.png出现二维码,手机扫码跳转到CTFSHOW登录页面【捂脸】看了眼wp,所以说找个QR解析工具看URL,得到:https://ctf.show/?ZmxhZ3vmiJjnpZ7lvZLmnaXlj5HnjrDoh6rlt......
  • 使Windows11支持同时多个用户远程桌面连接(RDP)
    参考:https://www.wyr.me/post/701一、配置远程桌面服务更改限制连接的数量将用户限制到单独的远程桌面服务会话(可选)二、为termsrv.dll增加修改权限C:\Windows\System32\termsrv.dll详情请参考:https://www.wyr.me/post/701三、停止RemoteDesktopServices服务打开......
  • 使用第三方RDP(远程桌面)客户端远程连接Windows10/11
    一、打开「编辑组策略」并定位  二、指定RDP为安全层三、禁用「要求使用网络级别的身份验证……」......
  • windows10创建conda环境失败:CondaHTTPError: HTTP 000 CONNECTION FAILED for url <htt
    问题描述创建新环境时,报错,创建不成功Collectingpackagemetadata(current_repodata.json):doneSolvingenvironment:doneCondaHTTPError:HTTP000CONNECTIONFAILEDforurl<https://conda.anaconda.org/conda-forge/linux-64/current_repodata.json>Elapsed:-AnHTTP......