MacOS Alferd3 支持 iTerm2

Mac 操作系统效率神器,关于 Alferd3 这里就不过多阐述了,想要了解更多的请看这篇内容《5 分钟上手 Mac 效率神器 Alfred 以及 Alfred 常用操作

 

Alfred3.dmg.7z

[reply]
Official Download
[/reply]

Custom输入框内容:

on alfred_script(q)
	if application "iTerm2" is running or application "iTerm" is running then
		run script "
			on run {q}
				tell application \"iTerm\"
					activate
					try
						select first window
						set onlywindow to true
					on error
						create window with default profile
						select first window
						set onlywindow to true
					end try
					tell the first window
						if onlywindow is false then
							create tab with default profile
						end if
						tell current session to write text q
					end tell
				end tell
			end run
		" with parameters {q}
	else
		run script "
			on run {q}
				tell application \"iTerm\"
					activate
					try
						select first window
					on error
						create window with default profile
						select first window
					end try
					tell the first window
						tell current session to write text q
					end tell
				end tell
			end run
		" with parameters {q}
	end if
end alfred_script

You may also like...

1个回复

  1. charles说道:

    感谢分享

发表评论

电子邮件地址不会被公开。 必填项已用*标注