Re: Applescript execution error under Rev but not Script Editor

2006-01-05 Thread Sarah Reichelt
> The following Applescript does work successfully when run in the
> Script Editor but return an execution error when run with «do fld
> "theScript" as Applescript»:
>
> THE SCRIPT:
> try
> tell application "Address Book"
> activate
> set theCard to person id "808C7253-74EA-4619-
> BC2D-3D030DEA63D9:ABPerson"
> tell me to assignPersonToGroup(theCard, "Patients")
> save addressbook
> end tell
> on error myError
> return myError
> end try
>
> on assignPersonToGroup(thePerson, theGroup)
> if (theGroup is not equal to "") then
> tell application "Address Book"
> set nameOfEveryGroup to name of every group
> if nameOfEveryGroup contains theGroup then
> set theGroupByID to group named theGroup
> add thePerson to theGroupByID
> else
> set newGroup to make new group with 
> properties {name:theGroup}
> add thePerson to newGroup
> end if
> end tell
> end if
> end assignPersonToGroup
>
>
> THE ERROR:
> "Impossible de rendre «class azf4» id \"808C7253-74EA-4619-
> BC2D-3D030DEA63D9:ABPerson\" of application \"Address Book\" dans le
> type attendu."
> translated in english: "impossible to render «class azf4» id
> \"808C7253-74EA-4619-BC2D-3D030DEA63D9:ABPerson\" of application
> \"Address Book\" in the expected type".
>
> MY QUESTION: Any clue to be able to execute the Applescript also in Rev?
>

Hi Joel,

I have found that you can't use separate functions in AppleScripts run
through Rev. Embeb the function's script in the main AppleScript
handler and I think it will work.

Cheers,
Sarah
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Applescript execution error under Rev but not Script Editor

2006-01-05 Thread Joel Guillod
The following Applescript does work successfully when run in the  
Script Editor but return an execution error when run with «do fld  
"theScript" as Applescript»:


THE SCRIPT:
try
tell application "Address Book"
activate
		set theCard to person id "808C7253-74EA-4619- 
BC2D-3D030DEA63D9:ABPerson"

tell me to assignPersonToGroup(theCard, "Patients")
save addressbook
end tell
on error myError
return myError
end try

on assignPersonToGroup(thePerson, theGroup)
if (theGroup is not equal to "") then
tell application "Address Book"
set nameOfEveryGroup to name of every group
if nameOfEveryGroup contains theGroup then
set theGroupByID to group named theGroup
add thePerson to theGroupByID
else
set newGroup to make new group with properties 
{name:theGroup}
add thePerson to newGroup
end if
end tell
end if
end assignPersonToGroup


THE ERROR:
"Impossible de rendre «class azf4» id \"808C7253-74EA-4619- 
BC2D-3D030DEA63D9:ABPerson\" of application \"Address Book\" dans le  
type attendu."
translated in english: "impossible to render «class azf4» id  
\"808C7253-74EA-4619-BC2D-3D030DEA63D9:ABPerson\" of application  
\"Address Book\" in the expected type".


MY QUESTION: Any clue to be able to execute the Applescript also in Rev?

Thanks.
Joël___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution