Jump to content

Bhishan

Member
  • Content Count

    137
  • Joined

  • Last visited

Everything posted by Bhishan

  1. In Alfred workflow, I can use most of the key combinations such as "Ctrl-M" and others. While working in jupyter notebook, I wanted to create a key combo "esc-m" that will toggle the cell to Markdown. But, I could not press the "ESC" key in Alfred workflow. Is there a way to simulate key press "esc-m" in Alfred workflow? Thanks.
  2. Date: Oct 11, 2018 Platform: MacOS Mojave I was running vim in the terminal and tried to use Alfred text expansion, but it does not work there. It gives the following error: Terminal seems to be preventing text expansion by locking secure entry For example, I have a snippet: ";;dd" for "date expansion". This works in all other text fields like TextEdit, Notes, and browser pages. But it does not work in terminal editor VIM. How to avoid this error?
  3. Thanks, I was assuming it was almost similar. Anyway this will be a good practice for me. Also, since Safari is working perfectly, most of the job is done. I mainly open safari and only few times open chrome and firefox.
  4. Thanks a lot it works for safari. But, when I changed "Safari" to "Firefox" I was having problem. How can it be made working for "Firefox" and "Googel Chrome" also? Simply changing Safari to them seems not working. Thanks a lot.
  5. You can use Mac app Mathpix snipping tool . It gives Latex version of OCR, but you have to convert latex to plain text manually.
  6. I was trying to write an Alfred workflow that will close all the other Safari tabs and also closes all other open safari windows open. There is keyboard shortcut "cmd opt w" which will close all other tabs. But I have to manually close all other opened safaries. How can this workflow be created? I have shared my preliminary workflow here. This is pseudo code: Sometimes watching movies Safari creates a lot of unwanted tabs and windows, I want to get rid of them and open only current tab. Thanks for help. on alfred_scri
  7. Link to workflow: workflow_link. Using the information from this apple stackexchange link, I tried to create an apple script to click the menu "Get LaTeX" from the app called "Mathpix Snipping Tool". NOTE: The Mathpix Snipping Tool is a great app, it can get the OCR of any image and converts it into LaTeX item. Since it is difficult to remember so many keyboard shortcuts, I decided to write alfred keyword to simulate "ctrl-cmd-m" of this app, but got problem and posted the question. Here is the code: tell application "Mathpix Snipping Tool"
  8. @vitor Apologies for forgetting to upload the MWE workflow. For completeness, uploaded posthumously: workflow link Its sunday evening here in Ohio USA. I was not expecting answer until monday. The Community of Alfred is awesome! I know there is one father and one mother of Alfred, I guess there are so many brother and sisters of Alfred who are helpful and active almost all the time. Sorry for the probable XY question. Rather, I should have explained the problem and seek for the suggestions from the expert. Its alw
  9. Update: The MWE workflow can be found here. tldr; Needed help using appplescrip to edit string, I know how to do in python. (The required workflow is working help needed to make it better.) I was writing an Alfred Workflow to render ipython notebooks `.ipynb` files nicely using nbviewer of github. For that we need to use the website: https://nbviewer.jupyter.org For example to render a ipynb file: https://github.com/bhishanpdl/pdl_practice/blob/master/a.ipynb We need to open https://nbviewer.jupyter.org and paste the above not
  10. @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.
  11. @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.
  12. @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 so
  13. 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 work
  14. For those who uses github and markdown, I have created a simple workflow to automatically create the Table Of Contents for the markdown files. The github website is: https://github.com/bhishanpdl/Alfred_MARKDOWN_TOC We can also find this package in packal.
  15. Thanks a lot @vitor I inserted an Utilites > Delay With 2 seconds, it worked for now. My attempt with AppleScript on alfred_script(q) tell application "Lepton" activate end tell tell application "System Events" tell process "Lepton" click menu item "Search" of menu "Gist" of menu bar 1 end tell end tell end alfred_script And, this works. Thanks a lot!
  16. Is there a simple way of opening an app and execute its menu command using Alfred ? For example, in Lepton app the keyboard combination `shift-space` will do the gists search. I would like to make an alfred workflow to do this search. Attempt: 1. Assign a hotkey 2. Lauch app Lepton 3. Key combo However, this will only open the app and does not run the key combo. Is there a simple AppleScript to do this? Or, am I doing something wrong here?
  17. It would be nice for Alfred to custom keybindings like : `ctrl-k ctrl-a` instead of only `ctrl-k`. That is two set of commands should be supported.
  18. Your link is broken. Probably you may want to share it on github or just share the code in this thread.
  19. @deanishe Thanks for the suggestion, it worked now.
  20. **Question** How to plot column0 vs column2 of a data file using Alfred and Python? Shared Workflow =============== https://github.com/bhishanpdl/Shared/blob/master/Alfred_questions/python_plots/aa python plots.alfredworkflow?raw=true Sample datafile: https://raw.githubusercontent.com/bhishanpdl/Shared/master/Alfred_questions/python_plots/data.txt The given workflow reads the column0 vs column1 of the given data file and plots it. Is it possible to make plot column0 vs column2 using arguments? Required Method: ==========
  21. Oh my goodness! I only looked at the source code (Run Script ) not at the "Copy to Clipboard" part! It was really silly, sorry for that. The good thing is it worked now and I will tackle similar problems easily in the future. You made my day, thanks.
  22. @deanishe Nearly perfect, It is a very simple issue, I can always delete backticks easily, but just to complete the question, it also pastes backticks. This time I used: I also tried this, but did not work: ans = extract_code_from_repl(query.strip("`")) # try1 ans = extract_code_from_repl(query.strip(r"`")) # try2 ans = extract_code_from_repl(query.strip("\`")) # try3
  23. @deanishe It also pastes only two backticks. Tested: https://docs.python.org/2/library/collections.html Here is my workflow: https://github.com/bhishanpdl/Shared/blob/master/Alfred_questions/text_manipulation/z Text Manipulation_new_python.alfredworkflow?raw=true
  24. @vitor, Sorry This time it only prints only two backticks: ``. I am unfamiliar with perl and ruby and learning regex in python. I could not fix the problem in ruby and again seek for the help. As long as the workflow works, It is immaterial which language I use: whether perl, ruby, or the mighty python. P.S. I appreciate your effort and help and apologize for asking XY-problem since I thought If it was in python I would have figure out myself after learning one simple example.
  25. @deanishe Dr. deanishe, Today I learned little bit "sed" thanks to admin "vitor" and trying to fix my problem. In the mean time, I saw a comment with python, where I feel more comfortable working in. Yes I was trying to copy the python REPL documentation and pasting it without ">>>" sign probably created using "reST" and "Sphinx". I am familiar with python and extremely unfamiliar with "perl" and "ruby". If only I get one example in python for this problem next similar problems I would solve easily using python and regex mo
×
×
  • Create New...