Move | Duplicate| Replicate selected records [+LaunchBar]

Mainly Lion issues ?
I have heard of general Growl issues which relate to the App-Store version of Growl, but I am still getting notifications on this system.

(I don’t have access to a Lion machine at the moment, but I can confirm that these problems are not arising with OS X 10.6.8 )

Sorry not to be able to help much at the moment …

(PS I haven’t found a good way to use LaunchBar in DT searches – for abbreviations of regularly used search gestures/patterns I might try something like Keyboard Maestro)

Thanks for the quick reply!

First, you are correct. My current version of Growl was installed from the AppStore. I cannot even find DTP in its list of applications. Is this to be expected?

Second, is there an instruction I can add to the script to activate DTP after the ‘go to oTarget group’ instruction? I just don’t get why DTP remains active but the focus is taken off the database I was in, and no new focus is performed. Interestingly, a poster before me wanted to avoid opening the new group, so it apparently worked for her, but is working opposite for me (Murphy’s Law, no doubt!)

Finally, I believe you have created a version 1.0, but mine still says 0.9 in the title bar when the dialog box comes up. Is this to be expected?

Cheers!

Just curious if there is any update, or if perhaps you have tried it on Lion.

I still have the same curious issue-I can run the script from LaunchBar, or from the script menu within DTPO, and the selected file moves or duplicates. The ‘…’ shortcut works perfectly, as well, to move the file to the parent group. All good so far!

But the window in which I am working loses focus, and greys out immediately after the last dialog box (the numbered list of potential destinations). Until I hit ‘OK’ in that dialog box, the underlying window remains the focused window (for example, the red, yellow and green buttons in the top left are colored, not grey). As soon as I hit ‘OK,’ the file moves or duplicates, and the window needs another click to become the active window.

I am presuming this is the underlying reason why it doesn’t move to the new group.

Also, it doesn’t matter whether I activate the script from LB or from the script menu.

Thanks for any suggestion!

Also, I solved the issue of Growl not working under Lion. I assume this became an issue because Growl is now an app, rather than a system preference, but I am far from an expert.

In any case, I took the liberty of changing your script from

tell application id "com.apple.systemevents"
		-- USE GROWL IF IT'S RUNNING
		if (count of (every process whose name is "GrowlHelperApp")) > 0 then

to

tell application id "com.apple.systemevents"
		-- USE GROWL IF IT'S RUNNING
		if (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0 

I hope you don’t mind my experimenting. I hope this is helpful in some small way for others using Lion.

I will keep experimenting with the script to figure out the window issue…

Cheers! (and thanks for the great script)

I’ve been continuing my experimenting, which, given my limited knowledge of AppleScript, might be more painful than you would expect, and had some success:

I changed the script segment:

-- NOTIFY RESULT BY GROWL (IF INSTALLED) OR WITH DIALOG BOX
				my Announce(oTarget, strVerb, (length of lstSelns), strNames)
				open window for record oTarget
				activate
			end if

to:

-- NOTIFY RESULT BY GROWL (IF INSTALLED) OR WITH DIALOG BOX
				my Announce(oTarget, strVerb, (length of lstSelns), strNames)
				tell application id "com.devon-technologies.thinkpro2"
					open window for record oTarget
					activate
				end tell
			end if

and now the target group opens in a small window. Hooray!

However, the new window opens with just the target group in focus, so that in my three pane view, the middle column has nothing except the greyed text, “No Groups.”

I was wondering two things:

  1. Is there a way to have the new window open to the target group, but WITH the group tree visible in the middle pane?

  2. Is there a way to change the size and/or position of the new window that opens?

Thanks for any input!

Fantastic script, houthakker. Just FYI on the Growl issue, I’m running Lion (10.7.3) and did NOT upgrade Growl to the AppStore new version, and the script is Growling perfectly. Your script has become absolutely essential to my DTPO workflow. Thanks so much! ~ Jeremy

Hi there,
I’m having some issue on running the script: files are moved but running it from the applescript editor returns me a “variable strReport is not defined”. What can it be?
Another question: I’m not using it with LaunchBar, should I clean up the code to make it “lighter”?
Thanks

I was running the script perfectly for several months, and it is very, very helpful!

I just upgraded to Growl through the AppStore, and now I am getting the same message, the the variable strReport is not defined, error -1763.

Any thoughts?

I uninstalled Growl, then reinstalled from the App Store. Now all seems back to normal.

Hello,

Have been using your script for a while and I wonder if you can post an updated version because in this thread there are many different updates and additions.

So if you don’t mind can you post the full version of the script again?

Thanks,

I think this is the version which I am using myself (attached).
DTMoveRecords-015.scpt.zip (461 KB)

Holy smokes! I’ve been manually replicating articles to groups using drag and drop or the contextual menu. I said, “There MUST be an easier way to do this!” and found your script a few moments ago. I threw it into my scripts folder, indexed in Launchbar, and WOW!

Thanks a bunch for sharing!

Great script, houthakker.

can it be modified to do the following:
a) ask for “Move”, “Duplicate” or “Replicate” before asking for the target folder.
b) Not show the result folder after success. and retain the same view as before running the script.
c) do not include folders/tags in the trash as a target.

Thanks!

This script is very interesting and powerful. Does anyone have more updated version that the one posted by OP above?

Just wanted to say that I found your script as a new user of DTPO and love it. This version is running fine on 10.9.3 without Growl installed. Thank you so much for sharing this functionality.

@houthakker – Many thanks for this great script. I’m having trouble getting it to run, no doubt through my own script ignorance.

I’ve saved the complete text in the Apple Script Editor, and invoke it from there by hitting the “Run” button, after having selected a record in DT.

I get the following error:
Syntax Error
Expected end of line but found “’’”

Note: the first of the 3 quotation marks appears to be an opening “smart quote”, while the other 2 are plain vanilla.

The Script Editor highlights the quotation mark that appears between register as application and houtkakker scripts, at the following point in the code:
" & strNames

tell application id “com.apple.systemevents”
– USE GROWL IF IT’S RUNNING
if (count of (every process whose name is “GrowlHelperApp”)) > 0 then
tell application id “com.Growl.GrowlHelperApp”
register as application “houthakker scripts” all notifications {pTitle} default notifications {pTitle} icon of application “DEVONthink Pro”
notify with name pTitle title strGrowlTitle application name “houthakker scripts” description strGrowlBody
end tell
else

Any thoughts?

Many thanks again.
Tom

The script in the zip that Rob posted six postings above this one (here) works without problems when opened in AppleScript Editor and Script Debugger. It appears, Tom, you might have inadvertently deleted part of the script or typed a character into the script that does not belong there. Things like that are easy to do in AppleScript Editor. On the possibility that an error might have been saved to the downloaded instance, I suggest quitting AppleScript Editor, deleting the bad copy of the script, and downloading a new instance.

Open the new instance in AppleScript Editor, compile it, and save it to a location in the Scripts menu of either DEVONthink

~/Library/Application Support/DEVONthink Pro 2/Scripts/… [add a folder of your own making to the end of the path]

or the system scripts menu

~/Library/Scripts/Applications/DEVONthink Pro

In the latter case, you might need to create the “DEVONthink Pro” folder. Then, you can use the script as Rob describes in this thread without needing AppleScript Editor.

(FWIW, Editor is an OK environment for writing and debugging scripts, but is not needed for day-to-day use of scripts. With Editor, it’s easy to introduce errors without noticing, and difficult to find their cause, sometimes.)

Korm - I’m grateful for your prompt, thorough and crystal clear reply.

I followed your instructions, and the script works like a charm. (The only glitch is the following error message, which comes after the script has successfully done what it was designed to do, and which I suspect has to do with some oddment in my Growl setup: error “The variable strReport is not defined.” number -2753 from “strReport”)

Thanks also for your observations on Apple Script Editor. I’ll be extra vigilant in the future, when I meddle with scripts in that environment.

Cheers,
Tom

Well, looks like there’s a bug in Rob’s script after all. It’s easy to fix. Open the script in AppleScript Editor and change this line


display dialog strReport & "

to this


display dialog "Notice:" & "

Note the double quotes at the end of the line. They introduce a string that spans several lines – make sure you leave the end-of-line double quotes.

Many thanks, korm - works perfectly now.