![]() ![]() The steps from the now archived docs are: You’ll want to use that for test-driving your app. I’ll go through them and provide detail and links for further reading. The steps involved are actually very simple. There’s not a lot to do, but the documentation is (1) old, (2) not maintained anymore, (3) very wordy. (The ¬ is a continuation character to allow you to hard-wrap long lines without breaking the script, mostly used when you’re going to be posting a script somewhere you don’t have control over line-length and wrapping.)Įr, I guess you still want an activate in there for MarsEdit, too, to bring it to the front in order finish up posting manually.Boilerplate to Add AppleScript to Your macOS App in 2020 Tell application "MarsEdit" to make new document ¬ ![]() Tell application "BBEdit" to set postText ¬ Here’s a version that uses a different (and in my mind, more AppleScript-y) approach (with the caveat I don’t have MarsEdit, so I can’t vouch for whether its make new document command works as “normal” in AppleScript, but you could always make the document like you do in your script, then set the body to postText after, using 2 steps, if needed): Neat to see that MarsEdit can just read files on disk into post bodies, too… Get there by clicking on the Scripts icon near the far right of the BBEdit menu, and choosing “Open Scripts Nice work there :-) There’s not so much extra code as doing everything a long way, which is totally normal when getting started with AppleScript. For the final step, you need to move this AppleScript to the BBEdit scripts folder. Set currentURL to ("file://" & currentURL)Ĭompile then save the AppleScript. Set currentURL to POSIX path of appleScriptPath Tell application "BBEdit" to set theFile to file of document 1 ![]() Paste the following text into the Script Editor app on your Mac ( warning: I’m no coder, and did this through trial and error based on other scripts, so this script probably contains some completely unnecessary code): on run One such tool I hacked together is an AppleScript to send a post from BBEdit to MarsEdit for final publishing. There’s something pleasurable about tweaking BBEdit to use it as a blogging tool. I recently splurged on BBEdit, the venerable HTML and text editor for the Mac. Okay, I can never own too many text editors. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |