Applescript problem with Textastic

I’m newbies and I’m trying to create an extension for the “Textastic” application that replaces my “TextEdit” app.

So I took the same AppleScript and I replaced “TextEdit” by “Textastic”, the application launches but I have an error when creating the new document.

error “The doc variable is not defined.” number -2753 from “doc”

Could someone please help me?

Are you sure Textastic supports AppleScript? If so, I’m pretty sure each app has its own AppleScript dictionary, and while some common terms are found across many apps, there may be difference in usage. You might try to find some examples of AppleScript scripts for Textastic on the web and see if you can adapt your existing code to reflect those.

Unfortunately I have already looked at this and no dictionary is available for Textastic! Does this mean that it does not support AppleScript?

I thought that is what it means, but it looks like there are some examples of scripting it out there, at least to a limited extent. See below. I was also able to write a simple AppleScript to work (just telling it to open) in Script Editor, so maybe you can get somewhere.

Ok, thank you very much. Sorry for my ignorance but I am a beginner as I already specified in my first message.

I’ll try to adapt my code.

No need to apologize, my mistake if I sounded impatient. I just meant that it might be possible, and I didn’t have time to try more specific approaches.