@DTLow, I started with your idea and one-line script, and did some testing to determine how to best get all child tags of a parent tag.
Here's what I found:
Your simple script worked, but it took ~10 sec to run with my 1500+ tags.
So, after some experimentation, I came up with this approach, which takes on ~0.24 sec:
AppleScript to Get List of Child Tags
property ptyScriptName : "Get List of Child Tags for a Parent Tag"
property ptyScriptVer : "2.0"
property ptyScriptDate : "2018-07-11"
property ptyScriptAuthor : "JMichaelTX"
tell application "Evernote"
### This Takes about 10 sec for 1500 Tags ###
(*
set parentTag to tag ".NB.IT"
set childTagList to name of every tag whose parent is equal to parentTag
*)
### This Takes about 0.24 sec ###
set parTagName to ".NB.IT"
set tagNameList to name of every tag
set parNameList to name of parent of every tag
set childTagList to {}
repeat with iTag from 1 to (count of tagNameList)
set tagName to item iTag of tagNameList
set parName to item iTag of parNameList
if (parName = parTagName) then
set end of childTagList to tagName
end if
end repeat
end tell
return childTagList
-->{"SOFTWARE", "IT_List", "Electronics", "IT"}
Thanks for sharing your complete script to get the list, and to do a recursive process to get all lower child tags.
I'll take a look at that and see if it also can be optimized.
38 minutes ago, DTLow said:
So it's just a matter if composing variable searchQuery
For multiple tags, it would be any: tag:Tag1 tag:Tag2 ...
So that would give us a list of Notes that were assigned any of the child tags. Unfortunately it would not allow any other Search criteria (like dates, inTitle, other tags), which the EN Win search will allow.
Idea
JMichaelTX 4,105
Using AppleScript to Process Tags in EN Mac
Continuing the discussion from:
@DTLow, I started with your idea and one-line script, and did some testing to determine how to best get all child tags of a parent tag.
Here's what I found:
Your simple script worked, but it took ~10 sec to run with my 1500+ tags.
So, after some experimentation, I came up with this approach, which takes on ~0.24 sec:
AppleScript to Get List of Child Tags
Thanks for sharing your complete script to get the list, and to do a recursive process to get all lower child tags.
I'll take a look at that and see if it also can be optimized.
So that would give us a list of Notes that were assigned any of the child tags. Unfortunately it would not allow any other Search criteria (like dates, inTitle, other tags), which the EN Win search will allow.
Link to comment
18 replies to this idea
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now