• 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
Requesting assistance with nomenclature
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Requesting assistance with nomenclature


  • Subject: Requesting assistance with nomenclature
  • From: Brian Christmas <email@hidden>
  • Date: Mon, 22 Sep 2014 15:32:42 +1000

G'day scripters

I trying to set a variable to part of a scroll views attributed text, namely the last paragraph, but can't seem to get the nomenclature right.

Any corrections welcome, please!

The script is below, and my last attempt is between the 'say' lines (I never get to 3)..

Regards

Santa


if canWeDrawNewMessage then
set textStorage to mainMessagesView's textStorage()
tell textStorage to appendAttributedString_(newText)
end if
if lineFeedFlag then set my bypassColorTrapping to false
if lineFeedFlag and my flashTheMessage then
set textStorage to mainMessagesView's textStorage()
set textStorageString to mainMessagesView's |string|() as text
set theTotal to (count of textStorageString) as integer
set theRange to (count of textStorageString's paragraphs) as integer
set theOffset to (count of paragraph theRange of textStorageString) + 1 as integer
try
say 2
set tempStorage to current application's NSMutableAttributedString's alloc's initWithAttributedString_(textStorage's (paragraph theRange))
say 3
on error errmsg
display dialog "Error in tempStorage " & errmsg
end try
repeat 4 times
try
tell current application to beep
set p to 1
try
tell textStorage to replaceCharactersInRange_withString_({theTotal - theOffset, theOffset}, "")
end try
set p to 2
tell mainMessagesView to display()
tell current application to delay 0.4
set p to 3
tell textStorage to appendAttributedString_(tempStorage)
tell mainMessagesView to display()
tell current application to delay 0.7
on error errmsg
display dialog "repeat loop " & errmsg & "  " & p
end try
end repeat
end if

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Now I'm <really> confused!
  • Next by Date: why doesn't this 'objectForKey()' work, please?
  • Previous by thread: Re: Now I'm <really> confused!
  • Next by thread: why doesn't this 'objectForKey()' work, please?
  • Index(es):
    • Date
    • Thread