Adding simple AppleScript support:#81
Conversation
mdbraber
commented
Jun 8, 2022
- Get current URL
- Get current Title
- Execute arbitrary JavaScript in main window#
- Get current URL - Get current Title - Execute arbitrary JavaScript in main window#
Fastmate/JavaScriptCommand.swift
Outdated
| var javascriptString = "" | ||
|
|
||
| if ((self.evaluatedArguments?.count) != nil) { | ||
| javascriptString = self.evaluatedArguments?[""] as! String |
There was a problem hiding this comment.
What does self.evaluatedArguments?[""] mean here? Is there a value for an empty key?
There was a problem hiding this comment.
TBH - I wouldn't be a sure if it would make sense, but it worked porting it directly this way from Obj-C. But some searching pointed out the correct way is to use self.directParameter (tested and it works). I've updated the PR - can you check?
There was a problem hiding this comment.
Looks better! Also please use the following unwrapping to avoid crashing on unexpected data types:
if let directParameter = directParameter as? String {
javascriptString = directParameter
} ...
mdbraber
left a comment
There was a problem hiding this comment.
@joelekstrom not sure how to nicely check this in without replacing your DEVELOPMENT_TEAM
|
@mdbraber To achieve this you need to do patched staging - |
Thanks, didn't know about patched staging. Considering I already created the PR - how can I remove those changes on Github? |
Revert development team changes
* In-app download support #82 Fastmate now downloads directly to a folder (which can be changed in settings) instead of opening an external browser. The old behavior can still be enabled in settings. * Add basic AppleScript support #81 * Add support for opening Fastmail https:// links #88 * Fix some shortcuts not working with new Fastmail layout #70 Big thanks to @mdbraber for all the work on these new features!
