0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Posted at
  • 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へアップデート時に当バグ発生のため作成
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?