Skip to content
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

Merged
merged 6 commits into from
Jun 10, 2022

Conversation

mdbraber
Copy link
Contributor

@mdbraber 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#
@mdbraber mdbraber mentioned this pull request Jun 8, 2022
Copy link
Owner

@joelekstrom joelekstrom left a 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

var javascriptString = ""

if ((self.evaluatedArguments?.count) != nil) {
javascriptString = self.evaluatedArguments?[""] as! String
Copy link
Owner

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?

Copy link
Contributor Author

@mdbraber mdbraber Jun 8, 2022

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?

Copy link
Owner

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
} ... 

Copy link
Contributor Author

@mdbraber mdbraber left a 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

@joelekstrom
Copy link
Owner

@mdbraber To achieve this you need to do patched staging - git add -p and only add the relevant lines of the xcodeproj instead of adding the whole file, skipping the development team part. Or edit the PR to remove those changes on github directly (I can help with that if needed)

@mdbraber
Copy link
Contributor Author

mdbraber commented Jun 9, 2022

@mdbraber To achieve this you need to do patched staging - git add -p and only add the relevant lines of the xcodeproj instead of adding the whole file, skipping the development team part. Or edit the PR to remove those changes on github directly (I can help with that if needed)

Thanks, didn't know about patched staging. Considering I already created the PR - how can I remove those changes on Github?

mdbraber and others added 2 commits June 9, 2022 17:25
@joelekstrom
Copy link
Owner

joelekstrom commented Jun 10, 2022

I added a commit which reverts the team changes - to do it manually in a PR you can view the changed files and click edit file:
Skärmavbild 2022-06-10 kl  10 41 45

@joelekstrom joelekstrom merged commit 219b216 into joelekstrom:master Jun 10, 2022
joelekstrom added a commit that referenced this pull request Aug 8, 2022
* 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!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants