Action Script DA automatic download

Dear all,

I am planning to use DA to automatically download pdf file after searching rss feeds of scientific journals using a specific search set and scheduled invokes. This action script unfortunately does not work:

on results(theResults, theSet, theQuery)
tell application “DEVONagent”
try
repeat with theResult in theResults
set theURL to (URL of theResult) as string
set theReferrer to (URL of theResult) as string
set theObjects to scanner objects of theResult
repeat with theObject in theObjects
if theObject ends with “.pdf” then add download theObject referrer theURL
end repeat
end repeat
end try
end tell
end results

How can I debug this script / see what happens after invoking it by the search set?

Thanks in advance!

Stephan

An interactive version using the results of the first search window is probably easier to debug and can be executed via the Scripts menu or by Apple’s Script editor.


tell application "DEVONagent"
	set theResults to search results of search window 1
	repeat with theResult in theResults
		set theURL to (URL of theResult) as string
		set theReferrer to (URL of theResult) as string
		set theObjects to scanner objects of theResult
		repeat with theObject in theObjects
			if theObject ends with ".pdf" then add download theObject referrer theURL
		end repeat
	end repeat
end tell

Thanks! This script works - also as an action script! Is there a way to to tell DA how to handle duplicate files, eg file links twice (Get PDF & View PDF)?

Thanks in advance

Stephan

No, the only possibility would be to script the handling of these items on your own.