-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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#
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks for this
Fastmate/JavaScriptCommand.swift
Outdated
var javascriptString = "" | ||
|
||
if ((self.evaluatedArguments?.count) != nil) { | ||
javascriptString = self.evaluatedArguments?[""] as! String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does self.evaluatedArguments?[""]
mean here? Is there a value for an empty key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks better! Also please use the following unwrapping to avoid crashing on unexpected data types:
if let directParameter = directParameter as? String {
javascriptString = directParameter
} ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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!