Open With

I want to open a selected Item in DTPO with Textedit. How do I do this with AppleScript?

This related to another thread I have about printing being too small. If I have a rich text note selected I want to use an applescript to automate right clicking on the Name, selecting “Open WithTextEdit.

Trying to make sense of AppleScript terms, the best guess I can come up with is from a duplicate finding script. Is the selection the text, or the name (tile)?

It seems simple enough, if DTPO has an absolute file path then It should be a matter of capturing that path and telling Finder to open with application TextEdit. How is this done?


Trying examples fromthe net and trying my best with the AS dictionary, this is the best I can come up with and for some reason, It still is doing nothing.

Thanks, the only problem seems to be that when It gets to TextEdit I get an error that I don’t have permissions to open that document.

I suppose that since this is a RichText note that I created within DTPO, DTPO is not letting go of control of It with allowing my own administrative permissions? How do I change that?


I followed directions exactly, even to the point of your saying this script is “AS IS”. I posted a follow up anyway just to say, followed directions and … Nope.

  1. I installed It in the proper folder found by the scripts menu, “Open Scripts Folder”
  2. I duplicated a font script that had been stock and pasted in your example and changed the name to ensure I had the correct applescript type (bundle, run only, etc)
  3. In DTPO, I had a RichText file name highlighted and then
  4. I ran the script example that you shared

That was the result that I posted of a permission error.

I just restarted in case there was anything else going on (this is an old hackintosh so you never do know for sure). At the moment I am back to getting no results at all - not even permission errors. Time for a short break to clear my thinking and I will get back to It.


There are more simple options to do this than writing and debugging scripts.

  1. You have mentioned that you have Keyboard Maestro-create a macro that calls your menu. If a selected document can be opened with TexEdit, then this macro will do that. If not, the macro will do nothing.

  1. Even more simple-TextEdit is the default OS X app to open RTF documents. If that has changed on your Mac, change it back and open a selected RTF documents from DEVONthink with the shortcut command-shift-o. If you are wanting to open HTML documents with TextEdit, then the Keyboard Maestro option would perhaps be the better option.

Thanks, an easy and elagant solution. KM saves my behind yet again.