Re: Missing something obvious
Re: Missing something obvious
- Subject: Re: Missing something obvious
- From: Deivy Petrescu <email@hidden>
- Date: Sat, 12 Dec 2009 23:20:50 -0500
On Dec 12, 2009, at 8:55 PM, Mark Ratledge wrote:
> Tried all those property selectors in Pages; no difference. "set the_url to contents of «class pSel» of document 1" works fine outside of the if else loop. The problem is still with the if else loop; the script blows right by it.
>
>
> set the_title to the clipboard
>
> tell application "System Events"
> set myApp to name of first application process whose frontmost is true
>
> if myApp is "Pages" then
> tell application "Pages"
> set the_url to the selection as text
> end tell
>
> else if myApp is "BBEdit" then
> tell application "BBEdit"
> set the_url to the selection
> end tell
> else
> return
> end if
> end tell
>
>
> set the_text to " <a href=\"" & the_url & "\" title=\"" & the_title & "\" class=\"external\">" & the_title & "</a>"
>
> set the clipboard to the_text
>
I may be missing something, but except for the point raised by Yvan, your script works fine.
And, it is not that it has a problem, Yvan just corrected your expectation.
What are you expecting?
Deivy Petrescu
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