Automator にも無いようだ。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | tell current application (* ファイル名の先頭に "." が付くファイルは exists で判別できない *) set lockfile to (path to temporary items as string) & "myAppLockFile.txt" end tell set skipit to 0 tell application "Finder" if exists file lockfile then set m_date to modification date of file lockfile (* コードの実行時間に応じて調整する。 以下の例では、前回の実行から3分経過していれば停止していると解釈してそのまま実行する *) set check_date to m_date + (3 * minutes) tell current application set now to current date end tell if check_date is greater than now then set skipit to 1 end if end if end tell if skipit is 1 then (* running *) else if skipit is 0 then set posixpath to POSIX path of lockfile tell current application do shell script "touch '" & posixpath & "'" end tell (* ここに本体を記述 *) tell current application do shell script "rm '" & posixpath & "'" end tell end if |