please help for a script

help for a script

Hi,
I have this script I done here some times ago:


tell application "DEVONthink Pro"
	activate
	set destinationGroup to create location "/collocazione"
	
	
	set scheda to create record with {name:"colloco", type:form} in destinationGroup
	replicate record scheda to current group
end tell


this creates an record in a sheet called ‘collocazione’ and makes a replicate in current group. I’d like to add 3 things to improve it, but I’m not a programmer, I hope someone can help me.

1- the name of the record has not to be ‘colloco’, but the name of the actually selected object in devonthink
2- the replicated record has to be grouped with the current selected object in devonthink, using the same name
3- the record has to be opened to edit it

For example. I’m in devon and I select a pdf called ‘work2’. I start the script and after the script I’d like to have a group called ‘work2’, and inside the group the pdf ‘work2’, and a new replicate record called ‘work2’ opened for editing datas.

I hope someone can add this 3 things can help me (a lot) to archiviate datas. Thank you.

f.

Eh eh I have done it by myself!

tell application "DEVONthink Pro"
	activate
	
	set destinationGroup to create location "/colloco"
	set theSelection to the selection
	if theSelection is {} then error "Please select some contents."
	set firstItem to item 1 of theSelection
	set current_name to the name of firstItem
	
	set scheda to create record with {name:current_name, type:form} in destinationGroup
	set theGroup to create record with {name:current_name, type:group} in current group
	move record firstItem to theGroup
	replicate record scheda to theGroup
	open window for record scheda
	
end tell

Thanks for all the scripts I used for example.

This script can be useful waiting for 2,0.

  • I create a sheet with all the fields I need for files I scan (origin, date, destination, et ceterae).
  • After a import from scan, I select the pdf, activate the script and devon group the scanned document with a replicant of a new record with fields I need, and opens me a record for insert the info about origin, date, etceterae.

Every document is grouped with a record with all the info about it, and opening the ‘colloco’ sheet I have a complete list of the file scanned with info about every file.
I hope this can be useful for someone.

f.