• 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: Missing something obvious
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Missing something obvious


  • Subject: Re: Missing something obvious
  • From: "email@hidden" <email@hidden>
  • Date: Sat, 12 Dec 2009 15:55:22 -0800

... And here's what I found in Snow Leopard.

Selection is a property of both the application and the document in Pages 4.03

This command:

> tell application "Pages"
> set the_url to contents of «class pSel» of document 1
> end tell

compiles as:

tell application "Pages"
set the_url to contents of selection of document 1
end tell

So which version of Pages you're running matters.

tell application "Pages"
--pages v4.03
set the_url to contents of selection of document 1
--works
set the_url to contents of selection
--works
set the_url to get contents of the selection of document 1
--works
set the_url to the selection of document 1
--works, but returns a reference
set the_url to the selection
--works
set the_url to the selection of document 1 as text
--works, but returns a reference
set the_url to the selection as text
--works

end tell

HTH,

ES

On Dec 12, 2009, at 3:25pm, email@hidden wrote:

>
> On Dec 12, 2009, at 2:43pm, Mark Ratledge wrote:
>
>> I have it saved as an application and run it from the script menu in the menu bar. The problem is the If loop to select myApp. This works fine from the script menu:
>
> Hmmm....
>
> Here's what I've found...
>
> In Pages, selection is a property of the document, not the application, so you need to address the document. (Don't know why yours would work from the script menu).
>
> But, the selection property seems broken, so using ScriptDebugger's Dictionary Explorer, I was able to get this:
>
> tell application "Pages"
> set the_url to contents of «class pSel» of document 1
> end tell
>
> All of these commands failed:
> --set the_url to contents of «class pSel»
> -- set the_url to get contents of the selection of document 1
> -- set the_url to the selection of document 1
> -- set the_url to the selection
>
> This in in Pages 2.02. Are you using the same?
>
>
> HTH,
>
> ES
>
> _______________________________________________
> 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

 _______________________________________________
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: Missing something obvious
      • From: "email@hidden" <email@hidden>
References: 
 >Missing something obvious (From: Mark Ratledge <email@hidden>)
 >Re: Missing something obvious (From: email@hidden)

  • Prev by Date: Re: Missing something obvious
  • Next by Date: Re: Missing something obvious
  • Previous by thread: Re: Missing something obvious
  • Next by thread: Re: Missing something obvious
  • Index(es):
    • Date
    • Thread