• 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
Re: Copying text from the AS Editor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying text from the AS Editor


  • Subject: Re: Copying text from the AS Editor
  • From: Nigel Garvey <email@hidden>
  • Date: Thu, 01 Aug 2013 12:46:15 +0100

In my message of Thu, 1 Aug 2013 11:30:11 +0100, I wrote:

>When you run the script applet, it'll be the frontmost application. You
>need _AppleScript Editor_ to be frontmost for the GUI stuff to work:
>
>  ### Use cut & paste to keep color formatting
>  tell application "System Events"
>    tell application process "AppleScript Editor"
>      set frontmost to true
>      set WindowName to name of window 1
>      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
>
>  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

I suppose the Tex-Edit Plus code could be better too:

  ### Use cut & paste to keep color formatting
  tell application "System Events"
    tell process "AppleScript Editor"
      set frontmost to true
      set WindowName to name of window 1
      keystroke "ac" using {command down}
    end tell
  end tell

  tell application "Tex-Edit Plus"
    activate
    tell (make new document with properties {name:WindowName})
      paste
      set size of its text to 8
      select insertion point before character 1
    end tell
  end tell

NG


 _______________________________________________
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


References: 
 >Re: Copying text from the AS Editor (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: Copying text from the AS Editor
  • Next by Date: Re: Copying text from the AS Editor
  • Previous by thread: Re: Copying text from the AS Editor
  • Next by thread: Re: Copying text from the AS Editor
  • Index(es):
    • Date
    • Thread