Jump to content
  • 0

(Archived) Bug in tags returned by AppleScript



I have noticed that a simple script to return a sorted list of tag names shows bugs. First, it returns tags that I've deleted from Evernote. Second, it returns duplicate tag names, although Evernote tags are supposed to be unique by name. In other words, the tag list returned by AppleScript is not the same as the list provided by the application.

Here's a script

tell application "Evernote"

set the_tags to tags
set the_names to {}
repeat with i from 1 to count of the_tags
set the end of the_names to the name of item i of the_tags & return
end repeat
tell me to simple_sort(the_names)
sorted_version of result
end tell

on simple_sort(my_list)
set the index_list to {}
set the sorted_list to {}
repeat (the number of items in my_list) times
set the low_item to ""
repeat with i from 1 to (number of items in my_list)
if i is not in the index_list then
set this_item to item i of my_list as text
if the low_item is "" then
set the low_item to this_item
set the low_item_index to i
else if this_item comes before the low_item then
set the low_item to this_item
set the low_item_index to i
end if
end if
end repeat
set the end of sorted_list to the low_item
set the end of the index_list to the low_item_index
end repeat
return {sorted_version:sorted_list, sorting_index:index_list}
end simple_sort

Link to comment

0 replies to this idea

Recommended Posts

There have been no replies to this idea yet


This topic is now archived and is closed to further replies.

This topic is now closed to further replies.
  • Create New...