链接
|
提取密码
|
---|---|
https://pan.baidu.com/s/1nN1EY8TxOKbD5HJavCuu7Q | urb1 |
试想一下下面这些场景:
当我们想用百度搜索一个东西,我们一般是这么做的:打开chrome,输入百度网址,输入搜索词。但有了 Alfred 之后,我直接快捷键调出 Alfred 输入框,输入:「搜索词」即可。
同时我们也看到了,是可以迅速打开软件的。
下面看配置 默认情况下不能直接百度 需要设置
1.打开Alfred的preferences,按下图操作。
再Search URL输入下面链接
https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&ch=&tn=baiduerr&bar=&wd={query}
选择刚才设置的baidu,设置完后就可以默认百度了。
2.shell
呼出Alfred后 输入>(自己配置)
如果习惯用iterm2,可以,但是需要配置一下
on write_to_file(this_data, target_file, append_data)
try
set the target_file to the target_file as string
set the open_target_file to open for access file target_file with write permission
if append_data is false then set eof of the open_target_file to 0
write this_data to the open_target_file starting at eof
close access the open_target_file
return true
on error
try
close access file target_file
end try
return false
end try
end write_to_file
on alfred_script(q)
-- Write the command to run to a file. This is done because Applescript quoting is impossible to get right, esp. for backslashes.
set tmp_dir to path to temporary items as string from user domain
set applescript_alfred_file to tmp_dir & "alfredscript"
set alfred_file to POSIX path of applescript_alfred_file
write_to_file(q & return, applescript_alfred_file, false)
-- Create this file, which prevents iTerm2 from restoring a saved window arrangement.
do shell script "touch ~/Library/Application' Support/iTerm/quiet'"
-- Test cases:
-- 1. iTerm2 running, has windows open. Should open a new window for Alfred command.
-- 2. iTerm2 running, no windows open. Should open a new window for Alfred command.
-- 3. iTerm2 not running, set to restores arrangement. Should not restore arrangement but open a new window for the Afred command.
-- 4. iTerm2 not running. No windows to restore. Should open a single window for the Alfred command.
-- 5. iTerm2 not running. Has windows to restore. Restores windows and then opens a new window for the Alfred command.
-- Compose a script. This is necessary because compiling in a 'tell application' command causes the app to be launched, which would happen prior to the creation of the quiet file.
set theScript to "tell application \"iTerm2.app\"
if (exists current window) then
tell current window to create tab with default profile
tell current session of current window
write contents of file \"" & alfred_file & "\"
end tell
else
create window with default profile
tell current session of current window
write contents of file \"" & alfred_file & "\"
end tell
end if
activate
end tell"
-- Invoke the script.
run script theScript
-- Clean up
-- do shell script "rm -f ~/Library/Application' Support/iTerm/quiet' /tmp/alfredscript"
end alfred_script
3.全局搜索文件
同样需要配置一下dir,把你想进行search的目录设置一下
坑:如果搜索不到文件或者app,那就重建一下索引,因为Alfred是基于mac自带的Spotlight的索引功能,说不定你曾经关了
命令行执行下面命令
$ sudo mdutil -E /
|
4.热键(自己随意配置)
效率起飞,操作瞬间happy,然而还有许多功能没有说到,诸如find quit ~ shut down restart 许多命令,就等待大家自己去发现吧