[TxMt] applescript: make new document

Timothy Bates tim.bates at ed.ac.uk
Thu Nov 17 15:00:34 UTC 2005


Hi,
While applescript is not how TextMate does its magic internally, it would be
nice to have some document creation tools, as this is how apps work together
in workflows on Mac.

I'd like to see  the following script which works in SubEthaEdit work for
TM.

(*    
    View Source in SEE
    Chris Biagini <http://assortedgeekery.com>

    updated Jan. 5, 2005
*)

tell application "Safari"
    set mySource to the source of document 1 as string
    set myName to name of document 1 as string
end tell

tell application "SubEthaEdit"
    make new text document at end of documents with properties {mode:"HTML",
text:mySource, name:"Source of: " & myName}
    activate
end tell

 
Dr Timothy Bates <tim.bates at ed.ac.uk>
Reader in Differential Psychology
University of Edinburgh
Dept Psychology
PPLS
7 George Square
EH8 9JZ

wk      +44 131 651 1945
FAX    +44 131 651 3461
home +44 131 332 3543
Mob   +44 790 386 4573






More information about the textmate mailing list