⚙️ 自动化 📖 官方

自动化脚本生成

使用 Cowork 生成 Shell 脚本,自动化日常重复任务

★★☆ 中级 10-20 min 2025年1月11日
📋

使用场景

每天都要做的重复性工作,为什么不让电脑自动完成?即使你不会编程,Cowork 也能帮你生成自动化脚本,一劳永逸地解决重复劳动。

💬

提示词

I want to create an automation script that:
- Automatically backs up the ~/Documents/ folder every day at 11 PM
- Backs up to external hard drive /Volumes/Backup/
- Only keeps the last 7 days of backups
- Sends a notification when backup is complete

预期结果

Claude 会: 1. 设计自动化方案 2. 创建备份脚本(使用 rsync 增量备份) 3. 设置定时任务(cron/launchd) 4. 添加通知功能

💡

使用技巧

  • 自动化脚本会在电脑上执行操作,请务必理解脚本内容或先在测试环境中试运行
  • 可以把多个小脚本整合成一个「早晨启动」或「下班收尾」脚本
  • 不懂编程也可以使用,用自然语言描述需求即可