Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Save selected browser text via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Save selected browser text via AppleScript
Authored by: bluedogranch on Feb 15, '08 12:35:23PM

That's a nice script by whoever wrote it.

I'm just learning Applescript and use this to copy text to a new BBEdit window and then clear the clipboard:

tell application "BBEdit"
make new document
paste selection
activate window
set the clipboard to ""

What I'd like to do is combine the way the URL, title and date are added to the file in the original script above, but have the script open a new file in BBedit and have it remain open so I can trim out some trailing text (links, "print this page", etc.) text before I save it.

So I changed

set theNote to open for access file pathstring with write permission
write writeString to theNote
close access theNote

to:

tell application "BBEdit"
make new document
write writeString to document

But I get an error when it runs: "Can't make document into type file."

Am in in over my head with this? I'm looking through the BBEdit scripting dictionary, but as I say, I'm just learning. Ideas?



[ # ]