• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Copying text from the AS Editor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Copying text from the AS Editor


  • Subject: Copying text from the AS Editor
  • From: Jim Brandt <email@hidden>
  • Date: Wed, 31 Jul 2013 17:56:01 -0500

I dislike the fact that when I print from the AS Editor, the text size is so big. There's not an option to format the printed output in a different text size than what is used in the Editor.

So, I'm trying to write a script that grabs the contents of the Editor's front window using a copy command to preserve the formatting of the Editor and pasting it into a Tex-Edit Plus document where I can decrease the font size. I created this script and saved it as an application.

When I open a script and have it in the front window, then run the app from the script menu pulldown, I get the current contents of the clipboard.

### Use cut & paste to keep color formatting
tell application "AppleScript Editor"
    tell document 1
        set WindowName to name
        tell application "System Events"
            tell process "AppleScript Editor"
                click menu item "Select All" of menu 1 of menu bar item "Edit" of menu bar 1
                click menu item "Copy" of menu 1 of menu bar item "Edit" of menu bar 1
            end tell
        end tell
    end tell
end tell

tell application "Tex-Edit Plus"
    make new document with properties {name:WindowName}
    activate
    tell front window
        tell application "System Events" to tell process "Tex-Edit Plus"
            click menu item "Paste" of menu 1 of menu bar item "Edit" of menu bar 1
        end tell
        select text of front window
        set size of selection to 8
        select insertion point before character 1
    end tell
end tell

Any clues as to why I can't get the text from the Editor?

TIA,

Jim
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Copying text from the AS Editor
      • From: Kaydell Leavitt <email@hidden>
  • Prev by Date: Re: inconsistent behavior
  • Next by Date: Re: Copying text from the AS Editor
  • Previous by thread: Re: inconsistent behavior
  • Next by thread: Re: Copying text from the AS Editor
  • Index(es):
    • Date
    • Thread