Tell Block With Variable
Tell Block With Variable
- Subject: Tell Block With Variable
- From: Gil Dawson <email@hidden>
- Date: Sat, 20 Dec 2008 18:16:24 -0800
Hi--
I need someone to help me figure out what I'm doing wrong.
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