• 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
Object Reference Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Object Reference Question


  • Subject: Object Reference Question
  • From: Oakley Masten <email@hidden>
  • Date: Fri, 20 Apr 2007 12:21:55 -0700 (PDT)

This is a tough one !!

(*I have a script that gets the object references of
requested text from a quark doc
*)
set Text2Find to "#102"
tell application "QuarkXPress"
		tell document 1
			try
				set ListOfReferences to object reference of ¬
every text of every story whose contents is Text2Find
--as text
			on error errMsg number errNum
				return ""
			end try

			return ListOfReferences

		end tell
	end tell

--example of a result
set RefText to (item 3 of ListOfReferences as
reference)

(*
a single reference from the list looks like this:
text from character 313 to character 316 of story 22
of document "SPR07B2_C_MM_4041_102" of application
"QuarkXPress"
*)

set theAnswer to RefText as text

--gives me   #102
 ------------------------------------------
(*
so my question is:

How can I parse out the object reference so that I can
collect the text from the object reference plus the
next 15 characters in the story.

--Like this:
*)
set TheNumber to  text from character 313 to character
331 of story 22 of document "SPR07B2_C_MM_4041_102" of
application "QuarkXPress"

--the answer would be something like:  #102_35448_07ar


(*
I then want to write back to the doc and replace the
TheNumber with a new one:

For example:
*)
  --replace current TheNumber with #666_35448_07pt

--Would it be something like this ??
tell application "QuarkXPress"
	tell document 1

set text from character 313 to character 331 of story
22 of document "SPR07B2_C_MM_4041_102" of application
"QuarkXPress" to “:  #102_35448_07ar”
end tell
end tell

(*
How do you deal with object references to compare them
and modify them.


Thanks for any insight on this one.
Oakley
*)
 _______________________________________________
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

  • Prev by Date: Quark crash with duplicate command
  • Next by Date: Re: Quark crash with duplicate command
  • Previous by thread: Re: Quark crash with duplicate command
  • Next by thread: file is already open & file wasn't open
  • Index(es):
    • Date
    • Thread