pTags V1.2 (Updated Version) , the pivot table of tags with refresh function

Updated on 2019.09.05

For those who use tag groups and group tags will be familiar with this diagram:

What if we can create this, and the content of “this” can be refreshed anytime:

The demo:

(1) My tags tree (about 300 tags in 12 main groups + sub-groups)

(2) First, the script asks for the main tag group.

(3) Second, the script asks for category tag groups. Any main-group or sub-group can be chosen, even for the sub-groups under the main tag group in (1).

(4) A pivot table of tags and items is generated as a pTags sheet. The “show group tags” is disabled in this demo.

If “show group tags” option is enabled:

(5) If we need to refresh the sheet, just choose the pTags sheet, and click on the same script button. The script will detect that there is an existing sheet, and ask for the option.


I will definitely use this script myself for organising my home-related matters and literature. The retro feel of item-category-view focused Lotus Agenda is almost there An app ahead of its time: Lotus Agenda.

The updated V1.2 is posted in the 3rd post: pTags V1.2 (Updated Version) , the pivot table of tags with refresh function

PS. It is possible that some scripts may have done it before, but I haven’t checked the forum. If anyone is aware of such scripts, please let me know - maybe I am just re-inventing the wheel!

2 Likes

Very interesting - I would definitely be interested in trying the script.

The options

property topTagGpLocation : "/Tags" -- the tag group that contains all tags
property theNewTagsViewLocation : "/Tags View" -- place to save newly created tags view
global showGroupTags -- ignore this line
set showGroupTags to true -- set to true for pTags sheet to include group tags, else set to false
property hourBetweenUpdate : 4

Only one option worths mentioning
Set showGroupTags to true for displaying group tags in the pTags sheet. It’s a technical reason that “global” variable method is used, given the script now serves the functions of both refreshing and creating new pTags sheet.

The pTags script is sharing the same two custom metadata fields with Tagger and AutoGroup script. The “identifier” name must be the same as below at the time of creation, but you can rename the fields any way u like afterwards.


One main script and one plist file.
The plist file is “Tagger.plist”. The file is shared with the Tagger script in here Tagger V2. Two unique features, half-useful, but still interesting (I think).
EDITED: 2019.09.04
V1.1 with (1) minor bug fixed on the script producing duplicated group tags occasionally (in the sheet only), and (2) perhaps a minor speed improvement.
EDITED: 2019.09.05
V1.2 add (1) function to refresh the pTags sheet; (2) makes you “feel” that it’s faster by asking all the options upfront.
I “set showGroupTags to false” by default, coz not everyone use group tags.

pTags V1.2.zip (491.3 KB)

Reminder:
(1) I haven’t verified the accuracy of the tags info in categories thoroughly. There are too many items to check. If you see any, let me know.

(2) The performance is improved but optimization is not easy. The speed of the script is depending on the amount of data to be retrieved in realtime (the more items under the main Tag, the longer it takes), and the speed of the computer. But the script won’t mess up with your data, just the sheet it is working on.

(3) I might check with the good guys from DT later to see if there are room for improving the speed by twisting the script a bit (mainly on a few lines of coding).

My mission is accomplished. I have utilised DT dictionary to create Stack, Tagger, pTags, and AutoGroup. DT is excellent at managing “items”, and I attempt to focus on “item” and “bits of an item”. I hope these scripts are interesting. They are to me.

Updated in the 1st post: V1.1 with (1) minor bug fixed on the script producing duplicated group tags occasionally (the script only do things in the sheet), and (2) perhaps a minor speed improvement.

The next version planning: The main tag and category tags info will be stored in the tagOr and tagAND field. That means if the same script is activated on the selected pTags sheet, the sheet will be updated according to the original criteria. This will kind of simulate a dynamic “refresh” of the sheet.

Updated Demo and script of V1.2 is post in the 1st and 3rd post.

V1.2 adds (1) function to update the content of existing pTags sheets; (2) makes you “feel” that it’s faster by asking all the options upfront.