Hello,
What seems to give me the least manual work is to use a custom meta data field and sort it by it in the smart group.
I’m new with AppleScript but this seems to do what I want [1].
The script tries to make provision for other potential field I might add.
I currently run that externally so I still need to understand how to inject it into DT.
My question is this: is there a way to loop through all documents of a group without going through the selection process which I see used a lot on the forum? ( set theRecords to (selection aslist))
Regards,
Philippe
[1]
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
tell application id "DNtp"
set theRecords to (selection as list)
set myNumber to 1
repeat with theRecord in theRecords
set recordMetadata to (custom meta data of theRecord)
try
set mdstorystamp of recordMetadata to myNumber
set custom meta data of theRecord to recordMetadata
on error errMsg
# for some reason if field never initialized, it is not part of the fetched record
set newMD to {mdstorystamp:myNumber}
copy newMD to recordMetadata
set custom meta data of theRecord to recordMetadata
end try
set myNumber to myNumber + 1
end repeat
end tell
I have now:)
It is functional, thank you but does require manipulations I would like to avoid.
Note that I have already ~10 smart groups like that and am adding more so I would need, if I understood correctly, to follow the process any time I wish to look at any of those smart groups.
Just putting those groups in “sorted by “StoryStamp”” seems faster to me.