我有一个 LaunchAgent,它在用户登录时调用一个应用程序。该应用程序加载一个网站。
启动代理
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>LaunchAgent.Test</string>
<key>RunAtLoad</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/Applications/MyApp.app/Contents/MacOS/applet</string>
</array>
</dict>
</plist>
应用
display alert set_cookies_for_URL("http://www.apple.com")
(* AppleScript's handlers all seem to become unusable after importing frameworks.
* To compensate, I'm relegating AppleScript/ObjC calls to the end of the file
*)
use framework "WebKit"
on set_cookies_for_URL(URL)
set web_view to current application's WebView's alloc()'s initWithFrame:(current application's NSMakeRect(0, 0, 500, 500)) frameName:"tempFrame" groupName:"tempGroup"
set web_view's mainFrameURL to URL
#delay to avoid release
repeat while ((web_view's isLoading) as boolean) is true
delay 1
end repeat
return "done"
end set_cookies_for_URL
我将如何将网站参数从 LaunchAgent 传递到应用程序?