Re: Tell Block With Variable
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