"Reverse Synchonize" script (updated)

A script I posted some time ago that will move an item in an indexed group to the Finder folder that corresponds to that group (reverse synchonization, as it were) was flawed in that it always created a fill in that folder named “DEVONtech_storage”. This version of the script now deletes that file. If you wish to retain that file, then don’t use this script, or comment out the section [A] code.


-- Script to move an internal database item to the indexed folder where it should reside
-- DO NOT USE THIS SCRIPT ON ITEMS THAT DO NOT RESIDE IN INDEXED FOLDERS
-- Warning: use this script at your own risk
-- Losing your data is one of your own risks
-- updated 20110225 -- see [A] below

tell application id "com.devon-technologies.thinkpro2"
	
	set theDatabase to current database
	set theGroup to current group
	set theSelection to selection
	set thePath to path of theGroup
	if theGroup is indexed then
		repeat with thisItem in theSelection
			if thisItem is not indexed then
				export record thisItem to thePath
				-- uncomment the following line when you are confident in this script, and want to have the script delete the internal item for you
				-- delete record thisItem
			else
				display alert "Warning!" message "Use this script on non-indexed items" as warning
			end if
		end repeat
		
		
		-- [A] 20110225 Added this next step to remove the DEVONtech_storage file from the target folder
		try
			set deleteDTS to "rm " & "\"" & thePath & "/DEVONtech_storage" & "\""
			do shell script deleteDTS
		end try
		
		synchronize record theGroup
	else
		display alert "Warning!" message "Do not use this script on groups that are not indexed" as warning
	end if
	
end tell

Thanks for posting this script! It’s about time to add the opposite of the “consolidate” AppleScript command :slight_smile:

“deconsolidate” would be welcomed by many - and then I’d retire this script. :stuck_out_tongue:

Amen to that! Thanks korm for posting the updated script that deletes ‘DEVONtech_storage’. I’d forgotten to mention that it is working well for me.

Version 2.0.8 will include this.

Hello.

I just upgraded to 2.0.9 DTP and read about this “deconsolidate” script in the release notes. Where is this script? I am having trouble finding it anywhere.

Thanks,
Robin

It’s included as a contextual menu instead of a stand-alone script. There is some discussion on how it works (which is great) in this thread.

Nice - thanks!