I’m trying to import a large number of .ris files and I want to do it via AppleScript, but I’m having no luck doing so. Can anyone please help? Thanks
[code]
property extension_list : {“ris”}
on adding folder items to this_folder after receiving these_items
set endnoteFile to":Users:me:Documents:MyLib.enlp"
– PROCESS EACH OF THE ITEMS ADDED TO THE ATTACHED FOLDER
try
repeat with i from 1 to number of items in these_items
set this_item to item i of these_items
set the item_info to the info for this_item
– CHECK TO SEE IF THE ITEM IS AN IMAGE FILE OF THE ACCEPTED FILE TYPE
if (alias of the item_info is false and the name extension of the item_info is in the extension_list) then
tell application “EndNote X3”
activate
set myDB to open endnoteFile
import this_item into myDB
close myDB saving yes
end tell
tell application “Finder”
activate
move this_item to trash
end tell
end if
end repeat
on error error_message number error_number
if the error_number is not -128 then
tell application “Finder”
activate
display dialog error_message buttons {“Cancel”} default button 1 giving up after 120
end tell
end if
end try
end adding folder items to
[/code]
–
Daniel