Jump to content

DEVONthink Browser & File Action


Recommended Posts

Thank you PaulF! I manually deleted the 2 or 3 files that contained quotes but nothing changed; I suspect some other characters not allowed by JSON could still be in the names of my files (i.e.: carriage return?) but don't know how to do it; BTW where did you insert the find and replace script? thanks again

N

Link to comment

Sorry to hear that.  As I stated earlier, the only change that I made was to escape quotes (") in group names, so if deleting your groups with quotes (") didn't help then I don't have any more insight.

 

I made the change in the script, dtp-list-groups.applescript, which I believe is the only AppleScript in the WorkFlow.

 

If this doesn't make sense, best wait for @brunoc but it isn't going to help with your other groups.

Link to comment
  • 4 weeks later...
On 1/24/2020 at 10:26 AM, Jasondm007 said:

@brunoc Thanks for sharing this workflow. It's fantastic - and has really improved my experience with DEVONthink! Thanks a ton!!

 

Quick Question: Is it possible - either with some modifications to the "search groups" portion of the workflow or by creating a new action - to include Global Smart Groups? I use these a ton, and would love to quickly access them in the same manner that your fantastic workflow does for normal groups.

 

Thanks again!

 

@brunoc Previously, I asked about the possibility of adding Global Smart Groups to your workflow, which I'm sure is quite the Herculean task given how different they are from the standard groups the workflow currently searches for. Would it be possible - and perhaps much easier - to, instead, add an option for the workflow to search for local smart groups (similar to how you've added an option for searching tags)?

 

Personally, I've started using these a lot lately. And, since they don't have the same sidebar section as global smart groups, your workflow would be great for quickly accessing them.

 

Thanks for your consideration! I use this workflow religiously these days!!

Link to comment
On 5/27/2020 at 3:22 PM, Jasondm007 said:

 

@brunoc Previously, I asked about the possibility of adding Global Smart Groups to your workflow, which I'm sure is quite the Herculean task given how different they are from the standard groups the workflow currently searches for. Would it be possible - and perhaps much easier - to, instead, add an option for the workflow to search for local smart groups (similar to how you've added an option for searching tags)?

 

Personally, I've started using these a lot lately. And, since they don't have the same sidebar section as global smart groups, your workflow would be great for quickly accessing them.

 

Thanks for your consideration! I use this workflow religiously these days!!

 

@brunoc I figured out how to implement the local smart group search, in a relatively hackneyed manner by making a few minor changes to the workflow's "dtp-list-groups.applescript" file. For some reason, you have to use the string version of "smart group." I have no idea why, but apparently it's a known problem?

 

In any case, here's the updated portion for others that might also want to be able to select local smart groups:

on reiterateOnGroup(theRec, thisDB)
	set my numCurrentLevel to (my numCurrentLevel) + 1
	tell application id "DNtp"
		repeat with r in (every child of theRec)
			set rType to ((type of r) as string)
			if ((type of r is group) or (rType is "smart group")) and (name of r is not in my lstIgnoredGroups) then
				my addToGroups(name of r, uuid of r, thisDB)
				if ((my numCurrentLevel < my numLevelMax) and (rType is not "smart group")) then
					my reiterateOnGroup(r, thisDB & " ▸ " & name of r)
				end if
			else if (my boolSearchTags is true) and (type of r is group) and (name of r is "Tags") and (my numCurrentLevel is 1) then
				set tmpSaveLevelMax to my numLevelMax
				set my numLevelMax to 2
				my reiterateOnGroup(r, thisDB & " ▸ " & name of r)
				set my numLevelMax to tmpSaveLevelMax
			end if
		end repeat
	end tell
	set my numCurrentLevel to (my numCurrentLevel) - 1
end reiterateOnGroup

 

Edited by Jasondm007
Link to comment
  • 1 year later...

Hi

I started building my own workflow to search and open groups & just came across yours.  I have a Q. re: your AppleScript - it looks like you run a recursive function to get all the subgroups - which was where I was struggling....is this correct, and is there no other way to do this?

thanks

 

Here's my script filter code, featuring annoying tricks to avoid reserved words in AS, decent on the free JSON Helper app in the MAS:

 

https://gist.github.com/derickfay/8ee52862be556f5e3eb9c759514f26b2

 

Edited by dfay
Link to comment

Hi @dfay

 

I hate to admit it, but after spending a ton of time tailoring the workflow to my needs, I ultimately stopped using it. I don’t mean to be critical of the workflow, as it works great for what was intended. I also found it super helpful for adapting, since most of this stuff is way over my head and I really appreciated @Bruno’s willingness to share it.

 

If I recall correctly, however, I ultimately stopped using it because I wanted something that was more dynamic. My changes to the workflow’s cache also just made things worse because I: (1) set the max level to something ridiculous, like 8 or 10 (which is way too deep if you need to refresh it often), (2) opened it up to local smart groups, and (3) had it save the icons of the groups to a folder in the workflow (I have some problems with my eyes, so the iconography and colors are probably a little more important to me than most). In some iterations of the script, I also added a match string which included the parent group for easier hierarchy searching, which only slowed things down further (again, entirely, my fault).

 

In case it’s helpful, I’ve shared my garish abomination of the workflow here:

You’ll find some things in the “dtp-list-groups” script that are specific to me, which you will want to edit out (e.g., icons for some specific databases, inboxes, etc.). However, this should give you a good start. I never used the workflow to move or create groups, so I have no idea how that portion of it performs. In addition, just be aware that when you run the cache update for the first time that it will take forever, especially if you’ve set the group level as high as I did.

 

If you come up with a better approach to things, please let me know. Since I usually index everything, at the moment, I just use Alfred to search for folders/groups, and then use my own open or reveal workflow to effectively mimic the behavior. Obviously, the approach won’t work for internal files, such as smart groups. But it’s more responsive to my needs. Cheers

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...