PDA

View Full Version : AppleScript help needed for ow5 & oo3


sangheeta
2008-03-24, 01:08 AM
Hello,
I often save some text from websites, like articles or tutorials in a very organized OmniOutliner document, by creating a new row for title, then a new row for the text, for a code etc.

tell application "OmniWeb"
activate
tell application "System Events" to keystroke "c" using command down
end tell
tell application "OmniOutliner"
activate
tell application "System Events"
keystroke return
keystroke "v" using command down
end tell
end tell
tell application "OmniWeb" to activate

It works pretty well for me, I can this way for example highlight the text and paste it in a new row in oo3. Then, I go back in oo3 to organize all my news titles rows and texts rows to have my well organized oo3 file, like for example, an all applescripts tutorials oo3 file I found on the web. ;-)

I know it is a very basic script, but maybe some of you can help me to make it more "expert like" or to make it more powerfull.

thank you.

troyb
2008-04-01, 04:19 PM
I might do something like this:


tell application "OmniWeb"
activate
tell application "System Events" to keystroke "c" using command down
set pageTitle to name of front browser as text
end tell
set mySelection to the clipboard
tell application "OmniOutliner Professional"
set myDoc to first document whose name contains "webclips"
tell myDoc
set myRow to make new row at end of rows
set value of cell 2 of myRow to pageTitle as text
set value of note cell of myRow to mySelection
set note expanded of myRow to true
end tell
end tell

sangheeta
2008-04-03, 12:26 PM
Thank you Troyb for this script.:)
The omnioutliner section is interresting for me.
But the line "set myDoc to first document whose name contains "webclips"" make me to have an oo3 document named "webclips" opened.

troyb
2008-04-03, 01:04 PM
Yes, sorry, that line is looking for an open OmniOutliner document that is named webclips. I did this instead of just asking OmniOutliner to activate since my desired document may not be the frontmost window. You can of course name webclips to anything you like if you were to do something like this.