0

我使用 Google Drive 的工作流程通常从 Finder 开始与我的 Google Drive 文件系统进行交互。当我需要打开一个文件时,我可以通过在浏览器中打开的 Finder (CMD + O) 打开它。我同样可以通过 finder 复制、删除、重命名、移动 Drive 文件。这很棒。

但是我无法轻松地学习如何从 finder 中创建Drive 文档(最好使用键盘快捷键),而是被迫转到 Web 界面并导航相同的文件系统并在那里创建它。这破坏了我的工作流程,似乎没有必要。

我有一个非常有用的快捷方式来处理 .txt 文件。如何为 Google Drive 文档实现相同的效果?

4

2 回答 2

1

如果您在查找器中突出显示任何 Google Drive 文件夹或子文件夹并单击鼠标右键,您将在菜单中获得“新建”选项:

在此处输入图像描述

于 2021-09-18T17:34:38.277 回答
0

为了使其正常工作,您的前 Finder 窗口需要打开到您希望在其中创建新文件的 Google Drive 文件夹。

1. 打开 Automator.app 并创建一个新的“快速操作”文件

在此处输入图像描述

2. 将“运行 AppleScript”动作添加到您的工作流程中,并将以下 AppleScript 代码粘贴到您的新“运行 AppleScript”动作中。

property tempNameExtension : ".txt"
property finalNameExtension : ".gdoc"
property newFileName : missing value

tell application "Finder" to set finderWindowName to name of Finder window 1

activate
set newFileName to text returned of (display dialog ¬
    "Please Choose A Name For Your New File" default answer ¬
    "New_File_Name" buttons {"Cancel", "Create New File"} ¬
    default button 2 cancel button 1 with title "Please Choose A Name For Your New File")

do shell script "echo ' ' > " & quoted form of finderWindowName & "/" & quoted form of newFileName & tempNameExtension
delay 15 -- Allows Time To Sync Temp File To Google Drive
do shell script "mv " & quoted form of finderWindowName & "/" & quoted form of newFileName & tempNameExtension & " " & quoted form of finderWindowName & "/" & quoted form of newFileName & finalNameExtension

在此处输入图像描述

3. 保存并命名您的新文件。我保存并命名了我的文件“Auto Google.workflow”

4. 打开系统偏好设置并导航到键盘/快捷方式/服务。向下滚动所有服务,直到找到您创建的新快速操作,然后为其分配新的键盘快捷键。

在此处输入图像描述

简而言之,此 Automator 快速操作将在您的 Google Drive 文件夹中创建一个扩展名为“gdoc”的新 Google 文档文件,该文件的名称是您在弹出的对话框中插入的名称。

这是我按下新创建的键盘快捷键后该过程的简短动画。

在此处输入图像描述

于 2020-02-10T16:36:28.040 回答