• 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: Tell Block With Variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tell Block With Variable


  • Subject: Re: Tell Block With Variable
  • From: Gil Dawson <email@hidden>
  • Date: Sat, 20 Dec 2008 20:42:59 -0800

Thanks, Michelle. The target environment is the same as yours. I'll go test there.

--Gil

On Dec 20, 2008, at 8:23 P, Michelle Steiner wrote:

On Dec 20, 2008, at 7:16 PM, Gil Dawson wrote:

As the only change (that I intended) was to use a string variable instead of a literal in the tell statement, I expected this to work. Is there something I missed?

I don't know. I copied and pasted both of your scripts into script editor, and they both ran without errors.


I'm running OS X 10.5.6 and Pages 3.0.2

-- Michelle

--
If you always reach your goals, you set the bar too low. If you never reach your goals, you set the bar too high.

On Dec 20, 2008, at 6:16 P, Gil Dawson wrote:
This works fine:

tell application "Pages"
	repeat with w in windows
		tell w to log "Name: " & name
		tell w's document to log "Path:" & path
	end repeat
end tell

This doesn't:

set AppName to "Pages"
tell application AppName
	repeat with w in windows
		tell w to log "Name: " & name
		tell w's document to log "Path:" & path
	end repeat
end tell

The second AppleScript prints the first log with the correct file name, then ends with the word "path" hilighted in the second log statement and a modal dialog containing the error message,

	Pages got an error: Can't make path
	of document of item 1 of every
	window into type reference.

As the only change (that I intended) was to use a string variable instead of a literal in the tell statement, I expected this to work. Is there something I missed?

--Gil

* - MacOS 10.4.11, Pages 2.0.2, Smile 2.6.9

_______________________________________________
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
References: 
 >Re: Tell Blocks Considered Harmful (was Re: open for access) (From: Shane Stanley <email@hidden>)
 >Re: Tell Blocks Considered Harmful (was Re: open for access) (From: Chris Page <email@hidden>)
 >Re: Tell Blocks Considered Harmful (was Re: open for access) (From: Ed Stockly <email@hidden>)
 >Re: Tell Blocks Considered Harmful (was Re: open for access) (From: Chris Page <email@hidden>)
 >Re: Tell Blocks Considered Harmful (was Re: open for access) (From: Rick Gordon <email@hidden>)
 >Re: Tell Blocks Considered Harmful (was Re: open for access) (From: Rick Gordon <email@hidden>)
 >Re: Tell Blocks Considered Harmful (was Re: open for access) (From: Chris Page <email@hidden>)
 >Re: Tell Blocks Considered Harmful (was Re: open for access) (From: Deivy Marck Petrescu <email@hidden>)
 >Tell Block With Variable (From: Gil Dawson <email@hidden>)
 >Re: Tell Block With Variable (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Tell Block With Variable
  • Next by Date: Re: Standard Additions documentation
  • Previous by thread: Re: Tell Block With Variable
  • Next by thread: Re: Tell Blocks Considered Harmful (was Re: open for access)
  • Index(es):
    • Date
    • Thread