on run {input}
set filepath to POSIX path of input
do shell script "touch " & quoted form of filepath & "untitled"
return input
end run
これまでのところ、それは機能しますが、ファイルに焦点を合わせて名前の変更をトリガーする方法はありますか? 名前の変更を自動にしたくありません。イベントをトリガーするだけです(ファイルを選択しているときに「return」を押すなど)。そして、私はあらゆる種類のモーダルを使用したくありません...
クイックサイドの質問: これを設定して、フォルダーまたはファイルを直接選択する必要がないようにする方法はありますか? 現在、 で「サービスの受け取り」を「files or folders
」に選択していFinder.app
ます。
== 更新されたコード ==
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
機能させることができますか?