Dokumente anlegen

Von Jürgen Schell. | 30 Dezember, 2010 - 15:19

Folgender Code legt ein neues RagTime-Dokument, beginnend mit einem Layout, an:

tell application "RagTime 6.5"
	set neues_dokument to (make new document at end with properties {component types:layout})
end tell

Dasselbe funktioniert natürlich auch mit anderen Komponenten zum Start. Hier für ein Rechenblatt:

Bei Bedarf kann man das Dokument auch gleich benennen, obwohl es noch gar nicht gesichert ist:

Oder man sichert die Datei gleich nach dem Anlegen:

set save_file to (((path to documents folder) as text) & "Testdatei.rtd")
tell application "RagTime 6.5"
	set neues_dokument to (make new document at end with properties {component types:layout})
	save neues_dokument in file save_file
end tell