V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
doudou1523102
V2EX  ›  MacBook Pro

Mac 的自动操作,可以共享一波吗?

  •  
  •   doudou1523102 · 2021-03-26 15:26:54 +08:00 · 5070 次点击
    这是一个创建于 1116 天前的主题,其中的信息可能已经有所发展或是发生改变。

    最近发现自动操作这个神器,比如复制文件夹的路径,右键创建文件 可以共享一下大家的自动操作吗? #工作效率 #Mac

    18 条回复    2021-03-29 11:18:45 +08:00
    linwenzhi0528
        1
    linwenzhi0528  
       2021-03-26 15:45:18 +08:00
    蹲一个大佬
    chonger
        2
    chonger  
       2021-03-26 15:46:29 +08:00
    惭愧,用 mac 十几年,从来不知道这玩意怎么用。
    kkkkkrua
        3
    kkkkkrua  
       2021-03-26 15:50:42 +08:00
    on run {input, parameters}
    set randomNumber to (random number from 100 to 270)
    delay randomNumber
    tell application "System Events"
    key code 59
    end tell
    return input
    end run

    do not Lock Screen 远程公司摸鱼的
    arare
        4
    arare  
       2021-03-26 16:47:24 +08:00
    automator 限制还是挺多的,运行速度也不理想
    一般我就用来补充缺失的快捷键操作,提高效率
    oldjerry
        5
    oldjerry  
       2021-03-26 17:42:06 +08:00
    一直知道这功能,也没发现什么特别有用的操作。孩子在家上网课的时候,经常要把老师发的 word 转成 pdf 存到 iPad 上用,在网上抄了个转换的操作,省的每次打开 word 选另存了。

    on run {input, parameters}
    set theOutput to {}
    tell application "Microsoft Word"
    launch
    repeat with thefile in input
    open thefile
    set pdfPath to my makeNewPath(thefile)
    set theActiveDoc to the active document
    save as theActiveDoc file format format PDF file name pdfPath
    close theActiveDoc saving no
    end repeat
    quit
    end tell
    return theOutput
    end run

    on makeNewPath(f)
    set d to f as string
    if d ends with ".docx" then
    return (text 1 thru -5 of d) & "pdf"
    else if d ends with ".doc" then
    return (text 1 thru -4 of d) & "pdf"
    else
    return d & ".pdf"
    end if
    end makeNewPath
    Dvel
        6
    Dvel  
       2021-03-26 18:08:33 +08:00
    复制文件夹的路径用不着自动操作,Cmd + Option + C 就复制了。
    VpChris
        7
    VpChris  
       2021-03-26 19:40:24 +08:00
    说不上共享方案 (因为我觉得肯定有比我好的
    给点思路把:
    1. 自动把 PDF 转 JPG (多少页就出多少个 Jpg.
    2. 结合 folder action 把文件夹里面新增的文件设一个提醒 (以记得看 我自己的用法是监控着两个文件夹, 一个自动同步百度云 一个 google drive, 有新文件就在 reminder 里面新增一个 reminder 然后依赖 omnifocus 的 ios 端 capture, 把这些提醒弄进来 omnifocus

    3. 之前还曾经用 automator 来做一个 quit all app (仅保留想保留的) 后来用 alfred 的一个 workflow 代替了
    4. word -> PDF 5 楼有给这个方案.
    qlqsh
        8
    qlqsh  
       2021-03-26 20:24:42 +08:00
    批量重命名。直接 Finder 里的操作,可以自定义为自己常用的方式。

    显示(/隐藏)所有隐藏文件
    STATUS=`defaults read com.apple.finder AppleShowAllFiles`
    if [ $STATUS == YES ]
    then
    defaults write com.apple.finder AppleShowAllFiles NO
    else
    defaults write com.apple.finder AppleShowAllFiles YES
    fi
    killall Finder
    Elethom
        9
    Elethom  
       2021-03-26 21:01:39 +08:00 via iPhone
    大部分都是定时运行的,手动触发的就只用了一个快捷键自动点 notification 的回复按钮。其实很多东西用 shell script 更方便。
    Elethom
        10
    Elethom  
       2021-03-26 21:02:14 +08:00 via iPhone
    @qlqsh
    Command Shift . 就可以显示隐藏文件了。
    qlqsh
        11
    qlqsh  
       2021-03-26 21:50:38 +08:00
    @Elethom 知道。这不是要记快捷键嘛。单独的几个还行。多了真的就记不住了。这可以直接在右键里,比较直观。
    Elethom
        12
    Elethom  
       2021-03-26 21:53:13 +08:00
    @qlqsh
    Folder Actions 是挺方便啦。
    yitingbai
        13
    yitingbai  
       2021-03-26 21:57:21 +08:00
    @Dvel 学到了, 果然可以
    Emrys365
        14
    Emrys365  
       2021-03-27 01:58:32 +08:00
    批量删除 PowerPoint 当前演示文稿中的备注: https://gist.github.com/Emrys365/f1a6a8567086d4cbdf340e6a8cb173a7

    批量删除 PowerPoint 当前演示文稿中的动画效果:
    https://gist.github.com/Emrys365/29f1d904d1d8244581a03fff27f8b581
    doudou1523102
        16
    doudou1523102  
    OP
       2021-03-28 17:33:55 +08:00
    @Dvel 是的,但是我有一个粘贴版的工具快捷键冲突了
    doudou1523102
        17
    doudou1523102  
    OP
       2021-03-28 17:35:30 +08:00
    @Dvel 我用文件路径是为了 在 iterm 中粘贴路径,这个比较方便
    strongcoder
        18
    strongcoder  
       2021-03-29 11:18:45 +08:00
    @doudou1523102 #17 终端路径问题用 Go2shell 更方便 你试试
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5004 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 03:58 · PVG 11:58 · LAX 20:58 · JFK 23:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.