AppleScript "to"통화가 눈에 띄게 시작하지 않고 실행할 수 있습니까?
-
14-11-2019 - |
문제
다음과 같은 AppleScript를 시작하도록 메일 규칙이 설정되었습니다.
using terms from application "Mail" on perform mail action with messages theMessages for rule theRule tell application "Mail" -- do stuff, including... CheckAddressBook(theName, theAddress) end tell end perform mail action with messages end using terms from on CheckAddressBook(theName, theAddress) tell application "Address Book" -- do stuff end tell end CheckAddressBook.
이 메일 규칙이 실행될 때마다 주소록을 시작합니다.활성화되지 않지만 갑자기 바탕 화면에 나타납니다.내 질문은 블록을 조용히 시작하도록 블록을 지시하고 완료되면 종료 할 수 있습니다.
해결책
AppleScript can't control an application without it running. That's just the way it works. There are other methods you might use to access the Address Book database without launching the application, but if you're using AppleScript to get data from your Address Book database the application has to launch. My recommendation would be to simply add a quit command as suggested by Fábio.
다른 팁
To read the Address Book Database without launching "Address Book.app" I´d suggest to have a look at the command line tool "contacts" available for free here. You would then run it from Applescript like do shell script "/usr/bin/contacts Peter"
and handle the values returned.