2017-01-04 13 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 
関連する問題