2017-01-04 6 views
0

오늘 AppleScript를 처음 사용했습니다.AppleScript "모든 메모를 가져올 수 없습니다."

tell application "Notes" 
    activate 
    get name of account 1 
     --> "iCloud" 
    exists folder "Archive" of account "iCloud" 
     --> true 
    count every note of account "iCloud" 
     --> error number -1728 from every note of account "iCloud" 
Result: 
error "Notes got an error: Can’t get every note of account \"iCloud\"." number -1728 from every note of account "iCloud" 

여기서 무슨 일이 있었는지 : 나는 오류 메시지가

tell application "Notes" 
    activate 
    set mainAccount to the name of account 1 
    tell account mainAccount 
     repeat with n in notes 
      log name of n as string 
     end repeat 
    end tell 
end tell 

:

내 Notes.app 여기

의 모든 노트의 이름을 로그인하여 시작 구함 내 스크립트입니다 ?

답변

0

계정에는 메모가 없으며 폴더 만 있습니다.

은 그래서 스크립트는 다음과 같이 쓸 수있다 :

tell application "Notes" 
    activate 
    set mainAccount to the name of account 1 
    tell account mainAccount 
     repeat with f in folders 
      repeat with n in notes of f 
       log name of n as string 
      end repeat 
     end repeat 
    end tell 
end tell