Jump to content

Bhishan

Member
  • Content Count

    74
  • Joined

  • Last visited

About Bhishan

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I was trying to log the path of the current working directory of Finder window to a text file in Dropbox, the AppleScript used has no problem but when used in Alfred it gives me the empty log file. Workflow: https://github.com/bhishanpdl/Shared/blob/master/Alfred_questions/aa Last Working Directory.alfredworkflow?raw=true Used AppleScript: tell application "Finder" if exists Finder window 1 then set currentDir to target of Finder window 1 as alias else set currentDir to desktop as alias end if end tell log POSIX path of currentDir Error log from debugging: [2018-11-20 11:24:03][ERROR: action.script] /Users/poudel/Dropbox/Research/zz_LastWD/ **Question** How to write the current path of Finder along with date in a text file using Alfred?
  2. The link https://transfer.sh/gSsvH/Get-News.alfredworkflow is broken.
  3. Thanks a lot, I figured it out. -- cd to Downloads try set folderPath to POSIX file "{query}" on error set folderPath to (path to downloads folder as text) end try -- try to delete items in Downloads if any try tell application "Finder" set itemsToDelete to every item of folder folderPath delete itemsToDelete end tell end try -- empty trash tell application "Finder" empty trash end tell
  4. This might be a very simple question, but I could not find an easy way to assign a keyboard shortcut to run Alfred with another workflow command arguments: For example: In Alfred: " throw" command will throw all the contents from the Downloads folder to Trash Folder. (workflow: Trash Downloads axelpeigne.trashdownloads) In Alfred: "emptytrash" command will empty the Trash contents using Alfred built-in command. Is there a way to combine these two commands and assign keyboard shortcuts for them? Required: ctrl-shift-E should run alfred commands `throw` and then `emptytrash`. My attempt workflow is here. Pesudocode: ``` tell application "Alfred 3" to run command "throw" tell application "Alfred 3" to run command "emptytrash" ``` Then just prepend a HOT key trigger to this File Script. I just don't know the actual AppleScript commands. Thanks.
  5. Thanks, I will contact the devs of that app.
  6. @vitor Thanks, now I can move the Fentere in the desktop corners. I have one follow up question. When I set up hot key to open Finder file to open with Fenetre, it does takes the file to the menu of Fenetre, I manuall need to go to Fenetre and click the menubar. Can it be made single workflow a) puts the file to the menubar of Fenetre 2) then opens it in Fenetre? Thanks a lot!
  7. There is a mac app fenetre using which we can make any window and youtube videos at the frontmost app. However, the keyboard shortcuts there works only when the frontmost app is fenetre. How to make the keyboard control make universal using Alfred workflow? For example, <alt-cmd-right> moves the fenetre window to right side. But it only works only when that app is highlighted. I would like to make it universal. If it is very time consuming to get all the keyboard controls of fenetre, I would like only to get the movement controls. e.g. only <alt-cmd-right> moves fenetre window right. Thanks a lot. I have shared my preliminary workflow here.
  8. @vitor For some reasons Cmd ` did not worked for me. I just remapped it to be Alt Cmd ` and disabled original alt-cmd-` combo. Now it works. No need to write any workflows, it was a hidden built-in feature. Thanks a lot.
  9. Many times I am running TWO bash terminals at the same time. In one terminal I can write code in vim editor, and in second terminal I can run the code, or do another things. I was looking if I can have some keyboard shortcut to switch between two terminals, without using mouse. cmd-tab will switch through all the open apps, not only two opened terminals. I was wondering how to achieve the goal. I have shared my workflow here. I found a code to activate the current terminal window from any frontmost app, but still looking for code to switch between two terminals. # Ref: https://apple.stackexchange.com/questions/231112/open-the-same-terminal-without-switching-spaces tell application "Terminal" if not application "Terminal" is running then activate else if (exists window 1) then activate else do script "" activate end if end if end tell Thanks a lot!
  10. I was trying to write a simple workflow to convert farenheit to celcius and display in alfred using script filter. Here is the workflow link. Code: import json import sys faren = float(sys.argv[1]) celcius = (faren - 32) * 5.0/9 data = {'valid': 'true', 'title': 'Farenheit to Celcius', 'subtitle': str(celcius) } data_lst = [data] data = {"items": data_lst} json.dump(data, sys.stdout) Problem: It gives following error IndexError: list index out of range How to fix the error? Thanks.
  11. I have shared an workflow that can be customized to display the world cities of our choice. By default it shows the time of Chicago, Kathmandu, and Brussels (America, Asia, and Europe cities). To add an city we need to edit the Script Filter, which is fairly simple: we need to write name of the continent followed by / and name of the capital city or the main time zone city if there are more than one time zones in that country. The full list of time zones can be found in this wikipedia page: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. The workflow can be download from packal: http://www.packal.org/workflow/simple-timezone . Sample screenshot:
  12. I had tried "esc-m" in one single combination. Now I used two different keys "esc" and "m" and now it works. Thanks.
  13. 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.
  14. 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?
  15. 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.
×