두 번 클릭 할 수있는 명령 파일을 실행 중입니다. 파일 이름 : Documents.command
터미널 창을 열지 않고 백그라운드에서 프로세스를 실행합니다. 따라서 터미널 응용 프로그램을 닫으려면 & pkill -f -a Terminal
을 사용하고 있습니다.nohup osascript do shell 실행 - 오류 발생
이전에는 작동했지만 이제는 내 문서 폴더가 두 번 이상 열립니다. 10 초 이내에 폴더를 닫으면 다시 열립니다.
스크립트 코드 :
#!/bin/sh
open ~/Documents
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
nohup osascript -e 'do shell script "'"$DIR"'/Documents.command"' & pkill -f -a Terminal
로그 파일 내가 녹음 한 표시 다음과 같은 오류가 :
ScriptingAdditions/Digital Hub Scripting.osax" cannot be used with the current OS because it has no OSAXHandlers entry in its Info.plist.
osascript: OpenScripting.framework - scripting addition "/System/Library/ScriptingAdditions/StandardAdditions.osax" cannot be used with the current OS because it has no OSAXHandlers entry in its Info.plist.
osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" cannot be used with the current OS because it has no OSAXHandlers entry in its Info.plist.
osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/pC Finder Injector.osax" cannot be used with the current OS because it has no OSAXHandlers entry in its Info.plist.
osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/SIMBL.osax" cannot be used with the current OS because it has no OSAXHandlers entry in its Info.plist.
syntax error -1757. Couldn't get error text because of error -1757.
무슨 일이 문제를 것 같다?
설명이 혼란 스럽습니다. 왜 폴더가 다시 열리 며 10 초와 관련이 있습니까? 로그 파일은 어떻게 생성됩니까? 백그라운드 프로세스가하는 일을 언급하지 않았습니다. '-f'를'pkill'과 함께 사용하지 않는 것이 더 낫습니다. 왜냐하면 전체 명령 줄이 아닌 _name_ 프로세스 만 일치시키기 때문입니다. – mklement0