Import AppleScript methods in another AppleScript?

后端 未结 4 1031
萌比男神i
萌比男神i 2020-12-29 05:24

Is there a way to use defined AppleScript methods in other AppleScripts which reference the original AppleScript with something similar to import (f.e. in PHP)?

I wr

4条回答
  •  北海茫月
    2020-12-29 05:45

    One way to import another script as a library is to define a property which is initialized by loading the library as a script object. You can then use the tell command to invoke the library functions.

    property pSkypeLibrary : load script POSIX file "/Users/sakra/Desktop/skype_methods.scpt"
    
    tell pSkypeLibrary
        setSkypeStatus("status", "mood")
    end tell
    

提交回复
热议问题