클립 보드의 내용을 변수로 설정하려고합니다. 이전에 해봤지만 충분히 간단해야하지만 오류가 발생합니다. 이전 내 코드에서AppleScript에서 클립 보드의 내용 설정
on checkiPadFinished()
set tempiPadSerial to "b"
tell application "System Events"
tell process "iTunes"
keystroke "c" using {command down}
set tempiPadSerial to the clipboard as string
if firstiPadSerial is tempiPadSerial then
return true
else if firstiPadSerial is "a" then
set firstiPadSerial to the clipboard as string
end if
end tell
end tell
return false
end checkiPadFinished
나는 전역 변수
를 선언글로벌 XXX, YYY, ZZZ, firstiPadSerial 세트 firstiPadSerial는 checkiPadFinished()에 "A"
호출은 외모와 같은 :
set doneiPads to my checkiPadFinished()
지금까지 모든 것이 제대로 작동한다고 말할 수 있지만 대신에 이상한 오류 메시지가 나타납니다.
EDIT : 실행중인 내용을 변경하지 않습니다. 나는 잃어 버렸다. 나는 오류 메시지를 적어 두었다. 하지만 나는 10 번째 버튼을 누르기 만 했으므로 메시지가 무엇인지 말할 수조차 없다.
«일정 hicoorng의»는 오렌지 색상에 대한 상수 시스템 이벤트로 나타납니다 - 당신은 당신이 사용하는 실제 코드를 게시 할 수 있습니까? –
어디서 시스템 이벤트 상수를 찾으십니까? 또한 모든 오류 코드 목록을 어디에서 찾을 수 있는지 알고 있습니까? Google은 applescript 오류 코드를 찾지 못하는 것 같습니다. – MrMannWood
시스템 이벤트 tell 문에서 오류 클래스가 "orange"로 컴파일되므로 스크립팅 정의 파일/System/Library/CoreServices/System Events.app/에서 찾으십시오. Contents/Resources/SystemEvents.sdef는이 속성이 모양 기본 설정의 강조 색상임을 나타냅니다. /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/MacErrors.h에있는 프레임 워크 헤더 중 하나에서 중간에 괜찮은 오류 목록이 있습니다. 응용 프로그램도 정의 할 수 있습니다. 자체 오류 코드. –