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

2021-03-26 15:26:54 +08:00
 doudou1523102

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

5099 次点击
所在节点    MacBook Pro
18 条回复
linwenzhi0528
2021-03-26 15:45:18 +08:00
蹲一个大佬
chonger
2021-03-26 15:46:29 +08:00
惭愧,用 mac 十几年,从来不知道这玩意怎么用。
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
2021-03-26 16:47:24 +08:00
automator 限制还是挺多的,运行速度也不理想
一般我就用来补充缺失的快捷键操作,提高效率
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
2021-03-26 18:08:33 +08:00
复制文件夹的路径用不着自动操作,Cmd + Option + C 就复制了。
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
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
2021-03-26 21:01:39 +08:00
大部分都是定时运行的,手动触发的就只用了一个快捷键自动点 notification 的回复按钮。其实很多东西用 shell script 更方便。
Elethom
2021-03-26 21:02:14 +08:00
@qlqsh
Command Shift . 就可以显示隐藏文件了。
qlqsh
2021-03-26 21:50:38 +08:00
@Elethom 知道。这不是要记快捷键嘛。单独的几个还行。多了真的就记不住了。这可以直接在右键里,比较直观。
Elethom
2021-03-26 21:53:13 +08:00
@qlqsh
Folder Actions 是挺方便啦。
yitingbai
2021-03-26 21:57:21 +08:00
@Dvel 学到了, 果然可以
Emrys365
2021-03-27 01:58:32 +08:00
批量删除 PowerPoint 当前演示文稿中的备注: https://gist.github.com/Emrys365/f1a6a8567086d4cbdf340e6a8cb173a7

批量删除 PowerPoint 当前演示文稿中的动画效果:
https://gist.github.com/Emrys365/29f1d904d1d8244581a03fff27f8b581
jimliang
2021-03-27 02:31:02 +08:00
doudou1523102
2021-03-28 17:33:55 +08:00
@Dvel 是的,但是我有一个粘贴版的工具快捷键冲突了
doudou1523102
2021-03-28 17:35:30 +08:00
@Dvel 我用文件路径是为了 在 iterm 中粘贴路径,这个比较方便
strongcoder
2021-03-29 11:18:45 +08:00
@doudou1523102 #17 终端路径问题用 Go2shell 更方便 你试试

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/765424

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX