Xserve colocation for MacSlash provided by   Digital Forest
MacSlash A Daily Dose of Mac News and Discussion
MacSlash
MacSlash
» FAQ
» Discussions
» Journals
» Messages
» Topics
» Authors

» Preferences
» Technorati Profile
» Older Stuff
» Past Polls
» Submit Story


Search MacSlash:
 







Listed on BlogShares

Team One Tickets

» Hannah Montana/Miley Cyrus at Houston Rodeo tickets
» Garth Brooks at Staples Center tickets
» Super Skins Party Tickets
» Penthouse Desire SuperParty Tickets
» National Finals Rodeo Tickets
» Cher Tickets Las Vegas
» Cirque du Soleil
» Las Vegas Hotels
» Houston Rodeo Tickets
» Using A Ticket Broker
» PBR Rodeo Tickets
» Joe Calzaghe vs Bernard Hopkins Tickets
» Oscar De La Hoya vs Floyd Mayweather Tickets
» De La Hoya Tickets
» Hanah Montana Tickets
» Joe Calzaghe Tickets
» Maxxis EnduroCross Tickets
» MAXIM Super Bowl Party
» How To Spot A Counterfeit Super Bowl Ticket


Shameless Plugs
» Mac Poker Site
» 2008 Democratic Primary Info


 
Opening & Tiling TextEdit Documents
posted by Trollaxor on Sunday March 09, @09:18AM
Mac OS X dwhite21787 asks

I need to open 4 text files at once, for a particular task. Right now, I highlight them in Finder and use TextEdit to open them. Then I have to resize the windows and move them so they tile the whole screen. Is there a way to script or tweak TextEdit to open four windows of specific size at determined locations? Or can someone suggest an app that can? Thanks - Doug

Resource Site For Switchers | Double-Sided Scanning in Leopard  >

 

 
MacSlash Login
Nickname:

Password:

[ Create a new account ]

Related Links
  • More on Mac OS X
  • Also by Trollaxor
  • Opening & Tiling TextEdit Documents | Login/Create an Account | Top | 22 comments | Search Discussion
    Threshold:
    The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
    Keyboard Maestro could help (Score:2, Insightful)
    by peterneillewis on Sunday March 09, @01:34PM (#121471)
    User #6739 Info | http://www.peter.com.au
    You could create a Keyboard Maestro [keyboardmaestrro.com] macro that opened each document in turn, resizing and repositioning the window. Trigger it via a hot key or palette.

    Let me know if you have any troubles getting it to work.
    [ Reply to This | Parent ]
    jedit (Score:1, Informative)
    by Anonymous Coward on Sunday March 09, @01:43PM (#121472)
    Oh hey... is this site still around?

    I'd give jEdit [jedit.org] a shot. I'm not sure the feature you want is there, but I'd be surprised if it isn't. There seems to be a plugin to do just about everything I've ever wanted, and a zillion where I was like "wow, who would ever think to do that...?"
    [ Reply to This | Parent ]
    AppleScript can tell TextEdit to do this (Score:3, Informative)
    by echoone on Sunday March 09, @02:10PM (#121473)
    User #18126 Info
    You can use AppleScript to tell TextEdit to size its windows.
    Here is an example:

    tell application "TextEdit"
            set bounds of first window to {20, 30, 300, 300}
            set bounds of second window to {300, 300, 600, 600}
    end tell

    You enter this in Script Editor which you find in your Applications->AppleScript folder

    The numbers are in pixels and refer to the {left,top,right,bottom} of the window.

    Henrik
    [ Reply to This | Parent ]
      Re:AppleScript can tell TextEdit to do this (Score:5, Informative)
      by drukepple on Monday March 10, @06:56AM (#121479)
      User #18127 Info
      AppleScript can also open the files for you.

      I find it easier to work with POSIX style file paths rather than the "normal" AppleScript paths, so the first four lines are setting up POSIX paths, then the following four lines convert them to AppleScript files. Finally, tell TextEdit to open them and position the windows (The lines that start with -- are comments; lines that don't get executed. I'm not counting them when I say things like "the first four lines").

      -- Set up paths to your files
      set file1 to "/Domain/summitprojects.com/Users/dru/Desktop/Neal Tunes.rtf"
      set file2 to "/Domain/summitprojects.com/Users/dru/Desktop/Have you forgotten?.rtf"
      set file3 to "/Domain/summitprojects.com/Users/dru/Desktop/imag eset.rtfd"
      set file4 to "/Domain/summitprojects.com/Users/dru/Desktop/Smar twoolS7ImageSets.txt"

      -- Turn your POSIX paths into AppleScript files.
      set file1file to POSIX file file1
      set file2file to POSIX file file2
      set file3file to POSIX file file3
      set file4file to POSIX file file4

      tell application "TextEdit"
                      -- Open file 1 and position it.
                      open file1file
                      set bounds of front window to {0, 22, 500, 500}
                      -- etc.
                      open file2file
                      set bounds of front window to {500, 22, 1000, 500}
                      open file3file
                      set bounds of front window to {0, 500, 500, 1000}
                      open file4file
                      set bounds of front window to {500, 500, 1000, 1000}
      end tell

      I don't know how comfortable you are scripting, but you can make this a little easier on yourself by setting up lists and functions...but the above approach might be easier to grasp up front.

      I couldn't resist making it a little more flexible adding variables for the width and height of the windows, and figuring out the tile positions from there. So, set up your desired window width and height in lines 5 and 6.

      -- Set up paths to your files
      set file1 to "/Domain/summitprojects.com/Users/dru/Desktop/Neal Tunes.rtf"
      set file2 to "/Domain/summitprojects.com/Users/dru/Desktop/Have you forgotten?.rtf"
      set file3 to "/Domain/summitprojects.com/Users/dru/Desktop/imag eset.rtfd"
      set file4 to "/Domain/summitprojects.com/Users/dru/Desktop/Smar twoolS7ImageSets.txt"

      set width to 500
      set height to 500

      -- Turn your POSIX paths into AppleScript files.
      set file1file to POSIX file file1
      set file2file to POSIX file file2
      set file3file to POSIX file file3
      set file4file to POSIX file file4

      tell application "TextEdit"
                      -- Open file 1 and position it.
                      open file1file
                      set bounds of front window to {0, 22, width, height + 22}
                      -- etc.
                      open file2file
                      set bounds of front window to {width, 22, width * 2, height + 22}
                      open file3file
                      set bounds of front window to {0, height + 22, width, height * 2 + 22}
                      open file4file
                      set bounds of front

      Read the rest of this comment...

      [ Reply to This | Parent ]
    textwrangler (Score:2, Informative)
    by jmckay123456789 on Sunday March 09, @07:23PM (#121475)
    User #12097 Info
    Give TextWrangler a shot. It is free and very nice. Under the "Window" menu is an "arrange" command that will tile all open windows in a number of ways.
    [ Reply to This | Parent ]
    Trollaxor to the Rescue! (Score:4, Insightful)
    by AlmostBoughtaLisa on Wednesday March 12, @12:24PM (#121497)
    User #12028 Info

    Thanks, T, for bringing an end to the "hiatus" [crazyapplerumors.com] and giving us some fresh meat to chew on.

    [ Reply to This | Parent ]
    Try Smultron (Score:0)
    by Anonymous Coward on Friday March 14, @03:28PM (#121510)
    An excellent free, open source editor. You can find it here:

    http://smultron.sourceforge.net/

    It completely replaces TextEdit for me. And unlike some other editors, it is a native Cocoa app that performs great.

    Willy
    [ Reply to This | Parent ]
    • 1 reply beneath your current threshold.
    Yes! (Score:2, Funny)
    by Anonymous Coward on Tuesday March 25, @11:01AM (#121573)
    Good to see MacSlash is still Back and On the Cutting Edge.
    [ Reply to This | Parent ]
    • Re:Yes! by Anonymous Coward Friday April 11, @02:42AM
    macvim (Score:0)
    by Anonymous Coward on Tuesday April 29, @12:03PM (#121885)
    open the files in one macvim window, set up the splits the way you want (:sp, :vs), and then save the session. (:mksession).

    http://macvim.org/
    [ Reply to This | Parent ]
      That was fun while it lasted. Powered by Slash

    [ home | contribute story | older articles | past polls | faq | authors | preferences ]
    Copyright © 1999-2007 MacSlash Inc.