所以我試圖創建一個服務,該服務將位於Finder的上下文菜單中,並允許在當前目錄中創建一個新文檔。創建一個automator服務在當前目錄中創建一個新文檔
我一直在做的是使用的Automator: 對不起一切都在法國^^
反正這裏是我使用檢索當前工作目錄中的AppleScript:
on run {input, parameters}
tell application "Finder"
set pwdAlias to insertion location as alias
if not (exists folder pwdAlias) then
set pwdAlias to (container of pwdAlias) as alias
end if
end tell
set pwd to POSIX path of pwdAlias
return pwd
end run
然後我將這個值設置爲一個變量,然後使用該變量創建一個新的文本文檔作爲文檔的路徑,最後我使用Finder中的Reveal命令顯示創建的文檔。
一切都工作正常,但劇本似乎總是遲到! 我的意思是,當我打開一個新的Finder窗口,並選擇我的服務,它是系統創建一個窗口上的文件,如下圖所示:
不過,如果我嘗試第二次,文件被在預期位置進行正確創建:
這是非常系統碰巧每次!
對不起,如果我不是很清楚,這不是很容易解釋!
好,否則,我運行的山獅,這裏是連接的Automator的項目:/ create_new_document
要添加只需要解壓縮服務,並把該文件在〜/庫/服務
希望能得到一些答案,但我擔心這只是一個Automator錯誤!
順便說一句,你的服務的鏈接被打破了! – markhunte