Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by GuiB

  1. Not exactly a single key, but you can assign a "double tap" from a modifier key. For example: Option+Option If you want a single key, you would need another application that can customize your key configuration from a lower level like Karabiner Element. I'm not using it since I didn't think of any tricks that I would use from it (yet), but I think this should make it possible for you to do what you want. However, just my 2 cents, honestly I don't know why I would assign my Option key to limit it to only pop Alfred since, as much as I love Alfred, my Option key is pretty useful to insert symbols. So I would be more inclined to use the Double Tap instead of going the Karabiner route. But you can try both and see what you prefer. Or, as an idea, you could set only your right (or left) Option key to pop Alfred so you have your other Option key to work normally Best!
  2. @deanishe, yep this is what I've seen yesterday as well. It seems to be on and off since may. I won't get my hopes up that they will come back... we will see
  3. @evanfuchs, yeah nofile.io seems to be down... not sure they will get back, but here is what I think are the 2 last scripts from my posts above. My answer regarding @Jasondm007 's script (using AppleScript): https://d.pr/f/2yFEeJ My other script (using Bash): https://d.pr/f/yLrWRS Hope this help!
  4. Make sure that your have checked/set those items: Do you have "[ ] Automatically expand snippets by keyword" checked? (This is your Master checkbox to activate the auto-expansion of your snippet in Alfred) Do you have the box under the column "A->" of your snippet checked? (This is the checkbox to activate a specific snippet for auto-expansion) Did you set a Keyword for you snippet? (This is what you need to type to activate the auto-expansion of your snippet)
  5. From my tests the bug is not because the keyword object is activated externally, but because it has an empty 'Title' or 'Subtext'. Your "{var:empty}" get changed to an empty string, so it does the same. For now, just replacing your '{var:empty}" to any string (but only spaces since Alfred strip them) will repair your workflow. So, the problem is "Getting" into a keyword object that has no Title or Subtext defined. I mean arriving to the keyword from another object won't work, but invoking it directly using it's keyword work.
  6. @Chris_YZX, I can still access it from the link above, but here is from another link/website in case this better work for you: https://d.pr/f/er1jIz
  7. @deanishe, yes, it wasn't clear if it was possible to retreive the contact information from the api, so I gave an alternative if @Dreamisdead could only get the name of the contact and have the contact information from is own Address Book database... But yes, if everything is inside your API, then yes it shouldn't be too difficult to write a script filter to extract the full contact information from the API. Also, a little tip, if you want to access the email or phone or something directly from your first Script Filter, you can make use of your modifier keys to access them directly. For example: CMD+Enter to get the email address and put it in your clipboard directly or opening a new email with this address directly... it's up to you! Happy coding!
  8. I don't know if I get it right, but if you want to search for a contact and get the output like the default contact search of Alfred, then you can search your address book database using a File Filter based on your contact name that you get from your first script filter and send the found contact to open in Alfred (if Alfred is set to "Open Contacts in Alfred"). What I mean is: [Your Script Filter] -> {query is now your contact name} -> [The File Filter that gives you a list of matches] -> [Open the match in Alfred] Here is an example: https://d.pr/f/yIPU1v Just change the "ys" keyword object to your Script Filter If you Employee name is always the first in the list then you can rapidly press a second Enter to go directly to the Alfred Contact Viewer (or automate this second Enter key press) It could be done by using a second Script Filter, but if you want to access your contacts database directly then I think using the File Filter could be an easy way To give credits, my File Filter that search the Address Book database is a modified version of @Vero workflow that you can find here:
  9. Just to add... this would also make it possible to copy a selection of the text that is further down in the view and paste only the relevant part that we want.
  10. It would be great if the right pane of the clipboard history (the preview side) could allow to scroll to read all the contained text when it is longer than the available space. Sometimes we could have multiple clipboard contents that have some changes further down where we can't see it so we can't really know which one to choose. There's the Large Type (CMD+L) that make it possible sometimes, but other times the text is too long to make it readable using Large Type. So, adding the possibility to scroll the preview would be great! Thanks
  11. I think this will give you what you want: You can download an exported snippet collection here: https://d.pr/f/wWdRPN Or, if you want to build them yoursel, create new snippets with: nmonth => {date +1M:MMMM} pmonth => {date -1M:MMMM} mmonth => {date:MMMM} You can find more about snippet date arithmetic and format here: https://www.alfredapp.com/help/features/snippets/ and here: http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns
  12. Ok, I understand, it's just a little confusing that it changes a feature from another place in the preference. Now, I'm seeing that checking from one place or the other uncheck the other. I was thinking that the "Use ← and → for folder navigation" would only work when inside Alfred's File Navigation (while browsing the file system) and not during a standard search so that in a standard search I could use the → key to open the file action menu and during a file navigation I could use the arrow to navigate in and out of folders. So, not so much of a problem, I was just confused a bit that after testing the file navigation feature with the arrow keys that when I unchecked the toggle to get back where it was, Alfred didn't revert to work the same way as before since it also unchecked the toggle from the Show Actions. I'll keep in mind that they are linked
  13. I'm not sure if it's intentional, but I like to use the → key to access the File Actions when finding a file in Alfred. However, I've been surprised that this key wasn't working anymore. Actually, I've been playing around with the File Navigation function to "Use ← and → for folder navigation" and now realized that when we uncheck this feature in the File Navigation preference, it also uncheck the "Show Actions : [ ] → " of the File Actions preference. I understand that both feature could be related, but it's a little surprising to find out that a checkbox manipulate another one on another preference pane and especially since the "→" key is checked by default to access the File Actions. I'm just wondering if this is wanted or not. If it is, maybe there could have a mention that unchecking the "Use ← and → for folder navigation" will also uncheck the one in the File Actions menu or maybe it would be preferable to pop a dialog to ask the user if it also wants to uncheck the arrow for the File Action as well.
  14. @shainekim ah, sorry, I read too fast and didn't see you wanted in a new window. For that I think there's a option in Chrome to open link in new window, but if you don't want to change your Chrome preferences for your workflow, here is some more way to do it... If you have problem with the "quoted form of" then it's better to url encode your string. It's quite easy with Python, so I showed you how to pass and access the output of it in this updated workflow. Also, I've seen that Google Chrome can be asked by the "open" command to open in a new window using the argument "--new-window", so I added an example with it and an example using AppleScript to open in a new window and another example using only a single Run Script using Applescript. Here is the updated workflow: https://d.pr/f/JnjG9F Have a look at the keywords: "yy3", "yy4" and "yy5"
  15. To give you another perspective... you may find it easier to use builtin Alfred object for your workflow. From my understanding, you can do what you want simply by using a Keyword object connected an Open URL object. Often, a website will give you their homepage if the search function has no argument (like if you open the url: https://www.youtube.com/search?q= ), so if it's what you want, then you don't need to check if the query is empty or not. However, if you want to direct to a different URL than you can use the 'Filter' object of Alfred to check if the query is empty or not. Here is a workflow I did to show you both method in case you want to go this way: https://d.pr/f/q0uX2H Also, I would recommand to use the Open URL with your default browser (since I think Chrome is your default web browser and this way it would follows your preference if you switch someday), but if you want to specify to open in Chrome then you can set it into the dropdown menu at the bottom of the Open URL object. Best!
  16. From your screenshot it seems to be ok, but if you copy+pasted the string from Alfred to your post above when you say: then we can see there's a space after the "x" at "x -cardhop..." that shouldn't be there... So please try by removing this space if it's there or by copy pasting this: x-cardhop://show?id={uid} I hope this helps!
  17. @luckman212, yes to use the output of the script I would use an Alfred External Trigger that is triggered by the JXA so we can do something from Alfred. So, yes you can write to a file or directly use the argument to the Alfred External Trigger. I've made an example here: https://d.pr/f/2rzrt1 Here is the inside JXA script for those wanting to see directly without downloading: ObjC.import('Foundation') const args = $.NSProcessInfo.processInfo.arguments const argv = [] const argc = args.count for (let i = 0; i < argc; i++) { argv.push(ObjC.unwrap(args.objectAtIndex(i))) } delete args // Use argv[1] and up for the input arguments Progress.description = "Progress indicator; Input Args = " + argv[1] Progress.totalUnitCount = 25; for (var i = 1; i < 26; i++) { Progress.additionalDescription = "Step at: " + i Progress.completedUnitCount = i delay(0.1) } Application('Alfred 3').runTrigger('progress_bar', {inWorkflow: 'gbProgressBarExample', withArgument: "Total Count = " + Progress.totalUnitCount})
  18. @bivalvegruff, the output you wrote means that the preference is not set on you computer, you should see an output that only mention: org.yanex.marta Did you sent the second command as well? ( defaults delete -g NSFileViewer ) This one is meant to be use if you want to revert back to Finder and should then give the output that you have now when writing defaults read -g NSFileViewer . You can try again with the first command only ( defaults write -g NSFileViewer -string org.yanex.marta; ) Here is what I get on my side in the Terminal: $ defaults write -g NSFileViewer -string org.yanex.marta; $ defaults read -g NSFileViewer org.yanex.marta
  19. I also sometimes want to have a way to see some kind of progress (mainly to see if my process as complete), so I used an Automator Process that is called from Alfred so a gear icon appears in the menubar to clearly show that the script is running. However, it stays at 0 and quit when it's done. So, it is a little like what you are after. I thought why not run an AppleScript applet from Alfred and found a way that can also accept an argument to the applet using JXA. For some reasons, the on run argv doesn't work directly to get the input arguments so we need to use the Objective-C bridge. In short, you write a JXA application (applet) using Apple Script Editor that would do the action that you want while updating the progress bar. Move the bundled application into your Alfred Workflow directory and call it (start it) from Alfred using a Bash script like: open ./progress_example.app --args "$1" As for the JXA script, it should look like this (edit to make it do the things that you want...): ObjC.import('Foundation') const args = $.NSProcessInfo.processInfo.arguments const argv = [] const argc = args.count for (let i = 0; i < argc; i++) { argv.push(ObjC.unwrap(args.objectAtIndex(i))) } delete args // Modify what is here after so your applet makes the action that you want // Use argv[1] and up for the input arguments Progress.description = "Progress indicator; Input Args = " + argv[1] Progress.totalUnitCount = 25; for (var i = 1; i < 26; i++) { Progress.additionalDescription = "Step at: " + i Progress.completedUnitCount = i delay(0.1) } Here is an example in a Workflow: https://d.pr/f/rQPVmD So, if you want to see your progress directly in Alfred you can use the rerun feature or if you want to have a popup that shows you the progress while you do something else, then you can try my solution and see if it fit for you. Also, it should also be possible with cocoaDialog or something else, but I didn't have the time to try it at the moment.
  20. @bivalvegruff, did you restart your computer or session? If you write in terminal defaults read -g NSFileViewer you get org.yanex.marta as output? Myself, I'm always opening the files using the Reveal in Finder action (CMD+Enter on a standard search or with the Reveal in Finder file action) and it works great on my side. However, if you open your file using only Enter while doing the file search then it seems that you need to also set another preference to Marta like: defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add '{LSHandlerContentType="public.folder";LSHandlerRoleAll="org.yanex.marta";}' This is all the same as what is explained at the Forklift website, so you can have a look here to have some more info: https://binarynights.com/manual#fileviewer Hope this helps!
  21. Alfred uses the default file browser from your Mac. Finder is the default, but some alternatives (like Path Finder) add a preference to set them as the default file browser (taking the place of Finder). Therefore, to do what you want, it's not really related to Alfred, but to your computer configuration. You can set Marta as the default file browser with the command (inserted into the Terminal): defaults write -g NSFileViewer -string org.yanex.marta; And revert to Finder with this command (if you want to switch back): defaults delete -g NSFileViewer * Note that you would need to restart you computer to make the preference active. Alternatively, if you don't want to change your computer preferences, you can specify an application to open the folder from the Alfred File Actions menu. When you are selecting a folder from Alfred, just press your File Actions key (the one(s) that you've defined in the Alfred preferences) and use "Open With" action and select the Marta application and it should open your folder in Marta.
  22. @Jasondm007 sorry, it seems I skipped your message, but to answer rapidly, yes that's pretty much what you need to do to change the action or application that will be run with the fileAlias. Simply change the line: tell application AppName to ActionToDoOn fileAlias
  23. @michaelwills sorry for the long delay! I got too much work on my side with no free time. Things are starting to settle down Sorry that the nofile.io link is not working anymore. Actually, I had a small update on my side that I needed to push here ;) So here it is: Update Version 1.2.5 What’s new: Cardhop Actions list should be in your own language (I’m getting the localization from the Cardhop application directly, so you should get the same thing as in the application) Some bugs fix Download link: https://d.pr/f/rQTPtu @michaelwills regarding the coffee, actually, I like pretty much all kind of coffee :) I’m not very difficult All the best!
  24. @Jasondm007 Here is the same thing, but using AppleScript. In short, change the last Run Script to an AppleScript one with this script: on trim(theText) return (do shell script "echo \"" & theText & "\" | xargs") end trim on run argv set my text item delimiters to tab set theFileList to text items of (item 1 of argv) repeat with theFile in theFileList set fileAlias to (POSIX file trim(theFile) as alias) tell application "Finder" to move fileAlias to folder (path to downloads folder) end repeat end run Here is a new workflow with this inside in case it is easier to make it work: https://nofile.io/f/qvNgR5gw0pe/-+Example+File+Multi+Selection+Tests.alfredworkflow This one should work and give you something to play around when using AppleScript All the best!
  25. By removing this small part, you made it work as before. Like you said, while doing a real test I saw that the last element in the list of selection wasn't working and found out it was because of problem with whitespaces. So I trimmed the surround spaces with the trimmedPath="$(echo -e "${file}" | tr -d '[:space:]')" line and the trimmedPath variable include the file variable but trimmed. However, now I did more tests and found out there's still a bug with this line and now use an alternative using piping to xargs to do the trimming instead. Now, this seems to work, but again, let me know if you still have a problem! Here is the updated script for the Run Script: # Change IFS to TAB and expand into an array IFS=$'\t' filesListArr=($@) # Loop over the file list array for file in "${filesListArr[@]}" do trimmedPath="$(echo -e "${file}" | xargs)" # Your script to be run mv -i "$trimmedPath" ~/Downloads done Here is your script but updated with this fix: https://nofile.io/f/hjT4JFt6AVw/-+Example+File+Multi+Selection+Tests.alfredworkflow And here is my workflow with this fix: https://nofile.io/f/c8K4KEpkjWa/Example+File+Multi+Selection.alfredworkflow --------- To explain a little more why the other script doesn't work, but worked before on my side. The problem is that I was removing all the space in the file path, while the second one doesn't (it just trim the begining and end of the string; which is what I wanted in the begining, but did it too fast ). I'm used to never insert space on my file name, so that's why it worked before. But, now I tested iton a file that's inside my "Google Drive" and it removed the space inside to output it like "GoogleDrive" and broke it. Now we should be good
  • Create New...