Alfred--想搜什么?

本文介绍如何通过Alfred这款强大的Mac应用增强搜索体验。包括快速启动应用、配置百度搜索、自定义shell命令及全局文件搜索等技巧。通过简单的设置步骤,让日常操作更加便捷高效。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

试想一下下面这些场景:

当我们想用百度搜索一个东西,我们一般是这么做的:打开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 许多命令,就等待大家自己去发现吧

Alfred是一款屡获殊荣的macOS应用程序,可通过热键,关键字,文本扩展等功能提高您的效率。搜索Mac和网络,并通过自定义操作来控制Mac来提高生产力。 启动应用程序并在Mac或Web上查找文件。阿尔弗雷德(Alfred)了解如何使用Mac并优先考虑结果。 通过使用热键,关键字并自定义搜索Mac和活动历史记录的方式,可以节省大量时间。 进入并浏览,预览文件并对其进行操作,而无需用手指离开键盘。 使用Alfred的剪贴板历史记录和代码片段功能,无需一遍又一遍地键入相同的URL或响应。 使用剪贴板历史记录可以找到您先前复制的任何文本,图像或文件,然后再次粘贴。 创建您自己的代码片段,然后键入一个简短的缩写,以将其自动扩展为全文代码片段,从长远来看,您可以节省数小时的输入时间! 借助Alfred的Powerpack,可使用功能强大的工作流程来更高效地执行任务,并减少重复的手动任务。 将热键,关键字和操作链接在一起以创建自己的工作流程;无需编写任何代码即可创建工作流。来自我们创建者社区共享的成千上万个导入工作流。 你是老板通过使用Alfred与macOS的深度集成来控制Mac,从而提高工作效率。迅速对文件和联系人采取措施,控制音乐播放器并调度系统命令。 为您的一天增添些乐趣;借助适用于iOS的Alfred Remote,将iPhone或iPad变成Mac的命令中心。 另外,看看其他音乐服务(例如Spotify)的许多工作流程。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值