• 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: copy/paste fails - summary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy/paste fails - summary


  • Subject: Re: copy/paste fails - summary
  • From: Robert Poland <email@hidden>
  • Date: Thu, 27 Oct 2005 18:57:05 -0600

On 27 Oct 2005, at 16:14, Robert Poland wrote:

OS 10.4.2
This script now fails.
Window 1 is a recipe I copied off a web page. I tried to retype the first line but it made no difference.


I see that the problem happens with other files that worked before. Am looking for some new program that may have caused this.

I tried copy unstyled and paste unstyled, no change.

Is there some secret code imbedded in the file? ucode?

tell application "Tex-Edit Plus"
    activate
    set fileName to name of window 1
    set w to window fileName

    select paragraph 1 of w
    set capitalization of selection to word caps
    copy
    set newName to clipboard
end tell

newName
--> {"Angel Hair Patties", «data styl0001000000000012000E00030000000E000000000000»}

The contents of the selection-object in Tex-Edit Plus is international text, Bob - which is why the returned list includes style data. If you're trying to get a string, you could either coerce the result:


-----------

set newName to clipboard as string

-----------

- or use "the clipboard" (from Standard Additions), rather than "clipboard" (from Tex-Edit Plus). (While "the clipboard" will still contain the style data, it returns the text that you want here.)

I'm not entirely clear about what you're ultimately trying to do. Whatever it is, you may be able to do it slightly more directly - without the need to select text, etc. For example...

To copy paragraph 1:
-----------

tell application "Tex-Edit Plus"
    activate
    tell paragraph 1 of window 1
        set capitalization to word caps
        set the clipboard to (get contents)
    end tell
end tell

-----------

To set a variable to paragraph 1:
-----------

tell application "Tex-Edit Plus" to tell paragraph 1 of window 1
    set capitalization to word caps
    set newName to it
end tell

-----------

---
kai

From Yvan KOENIG <email@hidden>; Use copy unstyled in place of copy.

From carefully hidden script on web;
copy selection to newName

Thanks all,
--
Bob Poland - Fort Collins, CO
http://www.ibrb.org/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >copy/paste fails (From: Robert Poland <email@hidden>)
 >Re: copy/paste fails (From: kai <email@hidden>)

  • Prev by Date: Re: copy/paste fails
  • Next by Date: Cannot set Japanese (non-Roman) font in Powerpoint
  • Previous by thread: Re: copy/paste fails
  • Next by thread: Cannot set Japanese (non-Roman) font in Powerpoint
  • Index(es):
    • Date
    • Thread