Bhishan Posted September 11, 2018 Share Posted September 11, 2018 (edited) I am trying to write an workflow that will do following things in github page: - go to the bottom of the page - click commit button The main thing is whenever we are editing a file in github online to commit the chages we have to go to the bottom of the page and click "Commit changes" button. The github does not have that button on the top of the webpage and also does not have keyboard shortcut to do that. Commiting and Pushing edited files from a terminal is pretty simple a simple bash function in `bash_profile` will do that easily, but while working on online pages, we need to scroll down each time if we need to commit the changes. It will not save a heavy amount of time but if it is possible, the Alfred workflow to do it worth it. Thanks. Edited September 16, 2018 by Bhishan Link to comment
dfay Posted September 11, 2018 Share Posted September 11, 2018 Fake.app is the easiest way to do stuff like this - but it may be overkill for your needs, if you don’t want to run the task in a separate browser. Bhishan 1 Link to comment
vitor Posted September 11, 2018 Share Posted September 11, 2018 You’re going about this the wrong way. Don’t automate the page, use their API. If you understand bash, here’s a simple script that uses their API to merge PRs. 10 hours ago, Bhishan said: If anybody know applescript This can’t be done with AppleScript. Automating the page requires you to inject JavaScript on the page to perform the actions. What exactly are you trying to do? Show us an example page and the exact action. Bhishan 1 Link to comment
dfay Posted September 11, 2018 Share Posted September 11, 2018 (edited) Well it can be done with Fake’s Applescript but it’s bc it’s doing the injection under the hood...but I agree that API is probably best. Edited September 11, 2018 by dfay Link to comment
Bhishan Posted September 11, 2018 Author Share Posted September 11, 2018 (edited) @dfay @vitor This task proved to be too complicated than I initially thought of. I was just trying to create some hot key that will commit the changes i made in a file in github while working online. Its not a big deal commiting and pushing a file from the local computer to the github online, I was just trying to avoid going to bottom of the page and clicking the green "commit changes" botton each time when working online. It takes just a second but I was looking for alternatives. Example: - open the README.md file online in github website - do some changes - now hitting some keyboard shortcut should commit the changes. What I can do: If I have already cloned the repo locally, I can upload the changed file using some bash commands using alfred. Edited September 11, 2018 by Bhishan Link to comment
evanfuchs Posted September 11, 2018 Share Posted September 11, 2018 I use a web-based software that is all button clicks with no keyboard shortcuts. Switching back and forth from mouse to keyboard drives me nuts. If the button is visible on the page, Keyboard Maestro's "Click at found image" is good for this sort of thing. Bhishan 1 Link to comment
Bhishan Posted September 12, 2018 Author Share Posted September 12, 2018 @evanfuchs Thanks for alternatives, but I do not have Keyboard Maestro and I was thinking it is possible with Alfred with not so complicated codes. Link to comment
vitor Posted September 12, 2018 Share Posted September 12, 2018 (edited) This is pretty easy to do with AlfredBookmarklet. The only code you need is document.getElementById('submit-file').click();. Here’s a ready-made version. Edited September 23, 2018 by vitor Bhishan 1 Link to comment
Bhishan Posted September 16, 2018 Author Share Posted September 16, 2018 @vitor Thanks a lot! This is a lot easier than what I did. I had done following: - Record the button clicking in Automator - Create an app and give System Permission - Use Alfred to Assign Hotkey to that application. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now