Is it possible to have an applescript write an applescript? If so how? Is the Applescript editor scriptable? Do I need to use it to create an application or can it be done directly? TIA.
The Script Editor app is scriptable and you can definitely have one script generate the code for another and even compile and execute it if you need to. I’ve never done this, however, so I can’t offer any specific code examples. Figuring out the exact syntax each application wants seems to require a bit of trial and error. I would open the Script Editor’s applescript dictionary and go from there. Hope this helps…
WF
Oddly, I have a script called “ScriptsWritingScripts” that does this.
Essentially, it writes to a dummy text file, saves it and the changes the file type to “ToyS”.
Weird but it works.
Jim Neumann
BLUEFROG
There are also other AppleScriptable things which can edit and run AppleScripts. For example, FileMaker Pro can compile and run AppleScripts. There is also osascript at the UNIX command line and a Perl module called MacPerl which allows Perl to create and run AppleScripts. It is the more likely scenerio that you would have an AppleScript run one of these tools and have it, in turn, send data back by way of creating another AppleScript. This allows you to utilize functions of these other environments in your scripts.