Jump to content
Bhishan

[SOLVED] How to write an Alfred workflow to "go to bottom of GitHub page and click Commit Changes" button ?

Recommended Posts

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 by Bhishan

Share this post


Link to post

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.

Share this post


Link to post

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 by dfay

Share this post


Link to post

@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 by Bhishan

Share this post


Link to post

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.

Share this post


Link to post

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

 

commit.thumb.png.9ed75449706c58dab555b6540ea674ca.png

 

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×