on run {input}
set filepath to POSIX path of input
do shell script "touch " & quoted form of filepath & "untitled"
return input
end run
是我到目前爲止,它的工作原理,但有沒有辦法,然後專注於該文件,然後觸發重命名?我不希望重命名是自動的,只是觸發事件(如在選擇文件時按「返回」)。我不想用任何一種模式的...AppleScript焦點/重命名文件(並點擊任何地方)
快側的問題:有沒有一種方法來設置這個讓我沒有選擇一個文件夾或文件直接,但可以通過這樣做,可以讓說,只要在Finder中點擊文件夾中的空白區域?現在我的中有「files or folders
」服務。
==更新的代碼==
on run {input}
set filepath to POSIX path of input
do shell script "touch " & quoted form of filepath & "untitled"
tell application "Finder"
activate
set target of Finder window 1 to POSIX file "/Users/oscargodson/Documents/designs/untitled"
end tell
tell application "System Events"
tell process "Finder"
keystroke return
end tell
end tell
return input
end run
如果我硬編碼工作的路徑!但我怎樣才能得到它作爲var
的作品?
你的意思是什麼?你的意思是在Finder中顯示? – Clark 2011-05-25 01:19:05
就像在網頁開發中一樣:重點。就好像你一次點擊一個文件,並將其標記爲藍色,或者如果你用箭頭鍵導航到文件... – 2011-05-25 02:58:23