Jump to content

alfred_user

Member
  • Content Count

    12
  • Joined

  • Last visited

About alfred_user

  • Rank
    Newbie

Recent Profile Visitors

155 profile views
  1. Wow, I never realized that you could drag files and apps from Alfred results. That's great, thanks!
  2. It would be helpful to have + and - buttons on the dialogue for the "Workflow Launch Apps / Files" workflow which open a file picker dialogue. This would allow you to quickly navigate through the filesystem to find the files you want to add, rather than having to find them in a separate finder window and drag them in. Clicking + on the picker could default to showing the /Applications folder, the user's home folder, or the most recent folder that the user had selected files from (if applicable). The dialogue referenced: An example of the buttons from the Users & Groups pane in System Preferences:
  3. Adding that icon key worked, thanks! I also realized I need the arg key in the object in order to pass the selected path on to the output. Completed script here: find ~/projects ~/internal -maxdepth 1 -name "*$1*" -type d | \ while read line; \ do /usr/local/bin/jq -n \ --arg uid "$(echo \"$line\" | tr -dc '[:alnum:]\n\r' | tr '[:upper:]' '[:lower:]')" \ --arg title "$(basename "$line")" \ --arg subtitle "${line/\/Users\/username/~}" \ --arg arg "$line" \ '{uid: $uid, title: $title, subtitle: $subtitle, arg: $arg, icon: { type: "filetype", path: "public.folder" } }'; \ done | \ /usr/local/bin/jq -n '.items |= [inputs]'
  4. @deanishe Thank you! I definitely wanted folders only so I went with the second suggestion. I replaced the File Filter with a Script Filter and this script: find ~/projects ~/internal -maxdepth 1 -name "*$1*" -type d | \ while read line; \ do /usr/local/bin/jq -n \ --arg uid "$(echo \"$line\" | tr -dc '[:alnum:]\n\r' | tr '[:upper:]' '[:lower:]')" \ --arg title "$(basename "$line")" \ --arg subtitle "${line/\/Users\/username/~}" \ '{uid: $uid, title: $title, subtitle: $subtitle}'; \ done | \ /usr/local/bin/jq -n '.items |= [inputs]' It uses jq to build the JSON output that Alfred requires. `jq` needs to be referenced by the full path of the binary, I'm assuming because Alfred does not have access to, or knowledge of, the shell's $PATH variable. One more thing I'd like for this workflow... I want to have each result row show a folder icon. As it is now it just shows the workflow's icon: I read the icon and type sections of the documentation but it's not making sense to me. I tried `"type": "folder"` and also `"icon": { "type": "fileicon" }` but neither seems to have any effect. It appears I could have an icon file loaded from a file but since my results are always going to be folders, is there an fast/native way to just display a folder icon (other than replacing the workflow's icon with a folder icon, since I want that to be different)?
  5. I've created a workflow with a File Filter, and set it to only show folder results: Then in the Scope tab I've added one folder: This works, but it produces results from all subfolders of the specified folder. Is there a way to restrict it to only show results from the root folder provided (and not subfolders of that folder)? I found this question from 2015 asking a similar question about the script filter, but there were no good viable solutions.
  6. Also, just found that copied image files are stored in the clipboard.alfdb.data folder in the same location. If I clear out the clipboard table using the command above, it still leaves the image files in that folder, so I've modified my script to be: setopt rmstarsilent # to override the rm * verification prompt in zsh (http://zsh.sourceforge.net/Doc/Release/Options.html#index-RMSTARSILENT) rm -f ~/Library/Application\ Support/Alfred/Databases/clipboard.alfdb.data/* sqlite3 ~/Library/Application\ Support/Alfred/Databases/clipboard.alfdb "DELETE FROM clipboard ;" I delete all files from that folder before clearing the rows from the database.
  7. @deanishe Thank you! I was able to accomplish what I was trying to do by adding this to my script, which deletes all rows from the clipboard table of that SQLite database using the sqlite3 command line tool: sqlite3 ~/Library/Application\ Support/Alfred/Databases/clipboard.alfdb "DELETE FROM clipboard ;" Works perfectly for my needs, but if I find that I want to preserve older clipboard history I will work on reading the Core Data timestamps in each row. Thanks again for pointing me in the right direction.
  8. Sometimes I need to perform tasks on my work computer which are related to personal matters or other companies. These tasks could potentially involve the copying/pasting of sensitive/confidential/proprietary information like hostnames, passwords, SSH keys, etc. So I wanted to have a way to "clean up" after so no artifacts or history of these operations remain on the system. So far my script successfully clears shell/terminal history, ssh known_hosts, system logs, network connection logs, temp/cached files, etc. The last thing I want to be able to do is also clear Alfred's clipboard history. What I do now is run my workflow and then immediately after run the "Clear Clipboard History" function, which only takes a second, but it would still be cool to be able to combine it into the one workflow. Side note: As an IT leader and problem solver, I appreciate your approach to solving this problem by identifying the larger issue, so I do want to mention that: I understand that using a computer that belongs to another company introduces some privacy considerations, but I am not concerned in that regard. I've verified that performing such tasks are not in violation of any company policies and I run the IT department here so I am aware of the security and monitoring software that is employed. Also, from a workflow perspective, I realize that completely wiping my system logs and shell history seems like an overkill solution to this problem, but I'm also not concerned with that. In general my typical "footprint" on company computers has been very minimal - I only install applications and store files locally that are 100% required for the tasks I need to perform, so this "clean up" workflow is a very useful and effective tool for me.
  9. I have a workflow that has one "Terminal Command" action which invokes a bash script (I tried using the "Run Script" action but couldn't get that working, but that's a separate issue). After the bash script runs I want both my Alfred clipboard history and macOS pasteboard to be cleared (the Alfred "Clear Clipboard History" function does both in one step). Perhaps clearing them could be accomplished in another way? Do you know where the Alfred clipboard history is stored?
  10. At a specific part in a workflow I want to be able to invoke the "Clear Clipboard History" function of Alfred automatically. Can this be accomplished?
  11. It is possible to set the number of result items rows for the main window: But there doesn't seem to be a way to set the number of rows for search result rows in the Clipboard History window. It seems to be set to show a fixed 15 rows:
  12. Back in the day there was a clipboard app called Flycut/Jumpcut. When you pressed the hotkeys to bring up the interface, you needed to hold the modifier keys, select which clip you wanted to paste, and then let go of the modifier keys to paste the clip into the active application. So basically, you would: hold cmd+shift then tap v while still holding cmd+shift, use arrow keys to scroll through clips when you have the clip you want to paste selected, let go of cmd+shift the content is pasted into the frontmost application With Alfred, when you press the modifier keys (in my case cmd+shift+v, it brings up the Clipboard viewer, but you have to let go of the modifier keys before you can use the arrow keys to navigate through the clips. And when you arrive on the clip, you have to press return to paste. Is there a way to make Alfred behave like Flycut/Jumpcut as described above?
×
×
  • Create New...