xcode - loading a html file from resources into webview applescript -
i load local html file resources web view in applescript objc app. have added files bundled resources i'm not sure how load them web view
tell mywebview setmainframeurl_("file.html")
sorry trivial question, help appreciated
to work have
add webkit.framework linked frameworks , libraries section in apps general settings. without ended error cannot decode object of class (webview)
create outlet. necessary allow applescript talk ui elements.
writeproperty mywebview : missing value
in appdelegate.applescript , save it. using interface builder view connect (ctrl-drag) app delegate web view , select mywebview. now property mywebview points straight web view. tell webview load html file app's resources folder:
set appresourcesposixpath posix path of (path current application text) & "contents/resources/" tell mywebview setmainframeurl_(appresourcesposixpath & "file.html")
enjoy, michael / hamburg
xcode applescript-objc
No comments:
Post a Comment