The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniWeb General (http://forums.omnigroup.com/forumdisplay.php?f=8)
-   -   OmniWeb Applescript Support (for DevonThink) (http://forums.omnigroup.com/showthread.php?t=1071)

dougray 2006-07-17 09:31 AM

OmniWeb Applescript Support (for DevonThink)
 
I was just over in the DevonThink forums looking for applescripts that will capture pages and web archives from OmniWeb and put them into DevonThink (they have similar scripts for Safari). According to DevonThinks main developer:
[INDENT]I've just checked the latest build of OmniWeb 5.5 - it's still not possible to get the source or web archive of a browser or tab via AppleScript.[/INDENT]
Is that something you would think of adding to OW 5.5? Thanks.

DougRay

pwg 2006-07-17 10:25 PM

I saw the post on the DevonThink forums from Christian (the programmer and administrator) and replied there. The DT 'capture to rich note' service .. with the default key cmd+) works just fine for me in SP17 and worked in SP16 too. That's one reason I'm using OW again as my default browser.

I don't know why it's not yet working in every case. But I can tell you that I 'clean installed' SP17 (dumped the prefs folder, the cache etc).

dougray 2006-07-18 05:56 AM

Yeah, I saw your post, but I was wondering more about the applescripts that DevonThink uses to capture full pages and web archives from a web browser (like it does for Safari). Do they use a similar mechanism as the Services menu or are they still hindered by some lack of script support in Omniweb? Thanks.

Terry 2006-10-31 05:39 PM

Bringing back a thread I didn't find an answer for.

I'm trying out DEVONthink, and am attempting to modify the script that stores a web page in the database.

The Safari script uses:
[INDENT][COLOR="red"]set this_url to the url of document 1[/COLOR][/INDENT]
The dictionary of OmniWeb doesn't appear use the same terms. From what I understand (probably don't) OmniWeb would use something like:
[INDENT][COLOR="Red"]set this_url to the address of browser[/COLOR][/INDENT]
or
[INDENT][COLOR="red"]set this_url to the address of tab[/COLOR][/INDENT]
Neither work, and not being very versed in AppleScript, I'm now stumped on how to extract the URL being displayed in OmniWeb and getting it into a variable.

Anyone have a working script?

Terry 2006-11-01 06:25 AM

Never mind. As usual, it was a short between the ears. I was running the script without OmniWeb first having had focus. Dumb, dumb, dumb.

forum member 2006-11-03 01:32 AM

[QUOTE=Terry]Never mind. As usual, it was a short between the ears. I was running the script without OmniWeb first having had focus. Dumb, dumb, dumb.[/QUOTE]

I'm running both lines and neither one works for me. Can you tell me what I'm doing wrong?

tell app "OmniWeb"
activate
set theURL to the address of tab
end

tell app "OmniWeb"
activate
set theURL to the address of browser
end

Terry 2006-11-03 04:14 AM

[QUOTE=forum member]I'm running both lines and neither one works for me. Can you tell me what I'm doing wrong?

tell app "OmniWeb"
activate
set theURL to the address of tab
end

tell app "OmniWeb"
activate
set theURL to the address of browser
end[/QUOTE]
What I did was modify the Safari script for OmniWeb. Here is the script to make a webarchive:
[CODE]-- Add web archive from OmniWeb to DEVONthink

tell application "OmniWeb"
try
if not (exists browser 1) then error "No browser is open."

set this_url to address of browser 1
set this_title to the name of browser 1

tell application "DEVONthink Pro"
set theArchive to create record with {name:this_title, type:html, URL:this_url}
try
with timeout of 60 seconds
set data of theArchive to download web archive from this_url
end timeout
on error
error "Download failed."
end try
end tell
on error error_message number error_number
if the error_number is not -128 then
try
display alert "OmniWeb" message error_message as warning
on error number error_number
if error_number is -1708 then display dialog error_message buttons {"OK"} default button 1
end try
end if
end try
end tell
[/CODE]

Terry 2006-11-03 04:19 AM

Also, the easiest way to add a link or archive is by using the Bookmarklets included in the dmg file. I added them to my bookmark bar, then just click either one. That's about as simple as it can get.

Omnius 2006-11-03 08:21 AM

elegant solution: Cocoa Suite offers the ability to create shortcuts for any menu option, also for service menu options like DEVONthink Pro


All times are GMT -8. The time now is 01:01 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.