Thanks!
Would these scripts presumably still work with Big Sur? I donât know code and was wondering if @pete31 (or someone) could perhaps walk me through these steps due to a hangup Iâm experiencing. My workflow:
- Installed âList and Record Toolsâ per developerâs instructions
- Open a new AppleScript window. So as not to confuse the first script from the second, I named the first one Part-1 before I pasted-in Peteâs first script. Running it gives me this:
Encouraging! So letâs say I now choose/select âmdoclcâ (third from bottom in my list) because I know for certain I have roughly 10 records in my entire database in which I assigned, manually, some alphanumeric (single-line) text in this custom metadata field. I then click OK. But now what? (I have been able to ascertain, by clicking OK, I get mdoclc
and nothing more/less in my clipboard. Is that all the first script is supposed to do?)
The problem Iâm having, is what Iâm supposed to do next. i.e. I donât understand what this means:
Identifiers are not deduplicated as this can be done in a text editor, e.g.
BBEdit Text > Process Duplicate Lines
.
Perhaps normal behavior; when I paste your second script into a new AppleScript window and click the little hammer icon, I get an error:
My goal is just to see all instances of my custom metadata field called OCLC before I vaporize it once and for all. I presume your second script is supposed to get me there, but I canât determine what Iâm doing wrong. Any guidance would be great. Thanks!
First off, letâs name scripts:
- Script 1: Copy Identifier (Copy Custom Meta Data Identifiers from plist)
- Script 2: Main script (Delete Custom Meta Data )
- Script 3: Verify main scriptâs result (Write Custom Meta Data Identifiers to file)
The text in brackets is the name of each script as in itâs first line.
This is not the order in which I posted them here.
No idea, still on Mojave.
Yes, it only copies one meta dataâs identifier on each run. Paste each meta data you want to delete in the main scriptâs property deleteMetadataNames
.
This is referring to script 3, the one that verifies the main scriptâs result. It outputs a text file with all meta data identifiers that are used in the selected records.
âNot deduplicatedâ simply means youâll get a full list of every selected recordâs meta data identifiers - instead of a deduplicated list. I did a lot of testing before I used the scripts and for that it was better to get a full list.
If you want to see whether the meta data was successfully removed you have to deduplicate it somewhere, e.g. in BBEdit. Thatâs of course not necessary; you could check the full list manually and watch out whether one of the meta data you removed wasnât removed. After all you could simply forget about script 3 - I wrote it for testing purposes, itâs not necessary at all.
However you could of course use it to get a full list before you use script 2 to see what meta data is currently used.
I can compile it in Script Editor. Please make the whole script visible in Script Editor, try to compile again and post a capture of the window.
Somehow I completely missed the obvious:
property deleteMetadataNames : {"mdtest1", "mdtest2"} -- set your Meta Data Identifiers here
I should be good to go but want to ask again about the query question from my OP yesterday. Your comment was of course probing if I wished to permanently delete both the metadata itself and the custom labels (custom metadata) I made, in DT3. Indeed the answer remains yes to both, but I want to first examine all the files in my database in which I actually entered something in a those (single-line text custom metadata) fields Iâm planning to delete for good. My intent is to then select-all and replicate those files to a temporary Group that I will name the same as the metadata field (and meta-data) Iâm going to vaporize for good. Can this be accomplished first somehow?
Thanks again for being so helpful explaining this to me @pete31! âŚand for the script!
No problem over here. If you need help just ask. However I would suggest to keep the two threads separated to avoid confusing other users.
I think youâre complicating things a bit, in the end itâs quite simple:
-
Copy a meta data identifier you want to remove
-
In the main script: Paste in
property deleteMetadataNames
-
Repeat until everything is set
-
Run the main script.
Thatâs it.
You could verify the main scriptâs result by running script 3 but thatâs not necessary. Youâre in the lucky position that I wrote, tested and ran the scripts on real data. They should work just fine for you too.
This Script: Remove some custom meta data should work.