Help us understand the problem. What is going on with this article?

AppleScriptでEvernoteのタグ作成時、親タグを指定できないバグを回避するハンドラ

More than 3 years have passed since last update.
  • AppleScriptでEvernoteのタグを作成するときのバグ
    • 親タグを指定しても反映されない
    • 常に最上位のタグになってしまう
タグの作成時に親タグを指定できないバグ.scpt
tell application "Evernote"
    set newTag to make tag with properties {name:"Child Tag", parent:tag "Parent Tag"}
    properties of newTag
end tell
--> {class:tag, name:"Child Tag", parent:missing value}
  • 上のスクリプトで最終行にparent:missing valueとある
    • 親タグを指定したにもかかわらず最上位のタグになっている
    • 本来ならparent:tag "Parent Tag" of application "Evernote"となるべき
  • バグを回避する方法
    • タグを作成した後に親タグを指定する
  • ハンドラにしたのが下のスクリプト
makeNewTag.scpt
tell application "Evernote"
    set newTag to my makeNewTag("Child Tag", tag "Parent Tag")
    properties of newTag
end tell
--> {class:tag, name:"Child Tag", parent:tag "Parent Tag" of application "Evernote"}

on makeNewTag(tagName as text, parentTag)
    tell application "Evernote"
        set newTag to make tag with properties {name:tagName}
        set parent of newTag to parentTag
    end tell
    return newTag
end makeNewTag

更新履歴

  • 2014-07-12: Evernote for Mac 5.6.0へアップデート時に当バグ発生のため作成
szk-3
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away