首页 > 计算机 >

mac os下程序窗口的最大化最小化快捷键实现

本文按署名·非商业用途·保持一致授权
作者:  ,发表于2007年04月27日21时36分 

把下面的代码存为一个.scpt文件,然后在用quick silver(当然也可以用其他可设置键映射的软件)的triggers里设置键映射到这个文件。以下脚本来自DZone Snippets

tell application "System Events"
	if UI elements enabled then
		set FrontApplication to (get name of every process whose frontmost is true) as string
		tell process FrontApplication
			click button 2 of window 1
			--button 2 is the green "zoom" button for all applications
			--window 1 is always the frontmost window.
		end tell
	else
		tell application "System Preferences"
			activate
			set current pane to pane "com.apple.preference.universalaccess"
			display dialog "UI element scripting is not enabled. Check 'Enable access for assistive devices'"
		end tell
	end if
end tell

一直很想要这个功能,但是苹果的系统一直没有支持。今天用mac application green button key zoom这几个关键词搜索到了。



2个评论

  1. SurfChen:

    测试

  2. DreamBox:

    受教了.谢谢分享..

发表评论

  本站文章若无注明,则以署名·非商业用途·保持一致授权
  桂ICP备05004302号 感谢医元网提供主机 感谢WordPress提供本程序 本模板下载