I have really try to learn me some scripting about to capture from a html document.
What I want to do is to multiple select any urls in DTP and when use the same function like “capture to HTML Page” in DTP from the menu by with a help with an applescript.
I have seen that DTP do the different approaches when you choose convert or capture to html inside DTP.
So I would be so happy to get a multiple selection script for this behavior to “capture to HTML Pages”
tell application id "DNtp"
repeat with theRecord in (selection as list)
if type of theRecord is bookmark then
set theURL to URL of theRecord
set theHTML to download markup from theURL
create record with {name:(name of theRecord), type:html, URL:theURL, source:theHTML} in (parent 1 of theRecord)
end if
end repeat
end tell
Only by using user interface scripting but that is usually not recommended as it depends on the localization and might break after updates. What exactly is different? The script is of course only a basic example and can be enhanced (an exercise for the reader )