newbie: external method library

Hi all,

I am just beginning to study applescript and am getting pretty frustrated. Going straight by the book (Nutshell) I am trying to set up a method library and call its scripts by another script. The method-library script reads:

on sayGoodbye()
display dialog “Goodbye”
end sayGoodbye

on sayTschuess()
display dialog “Tschüss!”
end sayTschuess

and is saved as a compiled script.

The calling script reads:

set bye to load script “Partition 4:Skripte:Methodenbibliotheken:farewell”

bye’s sayGoodbye()
bye’s sayTschuess()

and is also saved as a compiled script. The error-message I get reads:
“Can’t make “Partition 4:Skripte:Methodenbibliotheken:farewell” into a item”

The funny thing is: It works when I execute the calling script from within the smile editor window. But NOT, when I save it as a script and try to launch by clicking on it. And it does NOT work at all when started from within AppleScript Editor.

Very puzzled and appreciating all help,

Dirk

It might help to change this line:

set bye to load script “Partition 4:Skripte:Methodenbibliotheken:farewell”

to

set bye to load script file “Partition 4:Skripte:Methodenbibliotheken:farewell”

It might not solve all of your problems, but if it solves just one, it’s a step in the right direction. :slight_smile:

You might also want to check out this topic.

Hi Rob,

and thank you for the prompt reply! Indeed your suggestion to add the keyword “file” did the trick. So it must have been a typo in the book (where this keyword is NOT included - I counterchecked.)

Happy again and going on w/ my studying, best greetings,

Dirk
http://bbs.applescript.net/images/smiles/icon_biggrin.gif