Re: Finder > Tags.. access
Re: Finder > Tags.. access
- Subject: Re: Finder > Tags.. access
- From: Jim Underwood <email@hidden>
- Date: Sun, 23 Dec 2018 20:20:03 +0000
- Thread-topic: Finder > Tags.. access
Shane,
Thanks for sharing this script. Looks useful.
I also am getting a compile error:
Expected end of line, etc. but found “:”.
On this line:
set {theDict, theError} to current application'sNSPropertyListSerialization's
propertyListWithData:theDataoptions:0 format:(missing value) |error|:(reference)
Best Regards,
Jim Underwood
aka JMichaelTX
From: AppleScript-Users
<applescript-users-bounces+jmichael=email@hidden<mailto:applescript-users-bounces+jmichael=email@hidden>>
on behalf of Shane Stanley
<email@hidden<mailto:email@hidden>>
Date: Saturday, December 22, 2018 at 9:21 PM
To: "ASUL (AppleScript)"
<email@hidden<mailto:email@hidden>>
Subject: Re: Finder > Tags.. access
On 23 Dec 2018, at 2:15 pm, Jean-Christophe Helary
<email@hidden<mailto:email@hidden>> wrote:
For some reason the script does not give me the full list.
There's no official way to get the full list, but this *may* get what you want:
on fetchAvailableTags()
set thePath to POSIX pathof (path tolibrary folder from user domain) &
"SyncedPreferences/com.apple.finder.plist"
settheDatato current application'sNSData'sdataWithContentsOfFile:thePath
set {theDict, theError} to current application'sNSPropertyListSerialization's
propertyListWithData:theDataoptions:0 format:(missing value) |error|:(reference)
if theDict is missing valuethen error theError's localizedDescription() as text
set theTags to
theDict'svalueForKeyPath:"values.FinderTagDict.value.FinderTags.n"
end fetchAvailableTags
Then change:
set availableTagsto current application'sNSWorkspace's sharedWorkspace()'s
fileLabels()
to:
set availableTagsto my fetchAvailableTags()
--
Shane Stanley <email@hidden<mailto:email@hidden>>
<www.macosxautomation.com/applescript/apps/<http://www.macosxautomation.com/applescript/apps/>>,
<latenightsw.com<http://latenightsw.com>>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden