Jump to content

Cedric

Member
  • Posts

    41
  • Joined

  • Last visited

  • Days Won

    2

Cedric last won the day on June 22 2016

Cedric had the most liked content!

Profile Information

  • Location
    France

Recent Profile Visitors

1,324 profile views

Cedric's Achievements

Member

Member (4/5)

2

Reputation

  1. Unsure if it's the workflow or a gap in Alfred's framework, but thumbnail navigation is less useful than normal Alfred browsing when it comes video, as it doesn't show any preview. Thumbnail navigation Alfred's normal navigation
  2. I tried it before posting here, and it showed me only 5 screenshots and wouldn't show me more in my tests. Thumbnail navigation works perfectly for that purpose. Given that TN seemed to be the successor of RecentlyAdded with additional features, I focused on understanding what it could do instead of trying the navigate the issues in a different workflow. I've also tested it before posting here (I do try to do my homework, I promise), and what it did was give me a mix of recent screenshots and downloads in the same visual list, invoked from the same keyword. But I don't want to mix the two, i want to be able to invoke one or the other using a folder specific keyword (scr for screenshot, rdn for download). Thanks! That's great reassurance.
  3. Thank you so much for the Recently Added workflow. I can now go back to my usual rdn to find recent downloads. And I use Thumbnail navigation for recent screenshots by modifying the fast entry keywork to "screenshots" and the fast entry folder to the screenshot folder. I think browsing visually the recently downloaded is not adding much value, so the two workflows work best for their respective use cases. I am a tad worried about future updated to Alfred though, given that you recommend replacing RecentlyAdded with Thumbnail Navigation. Any way to get an for more than one fast entries and a choice for a thumbnail vs list presentation of the results? Thanks!
  4. I've been a long time user of the RecentlyAdded workflow, and as I was cleaning up my list of workflow, I uninstalled it by mistake. I saw on the forum that this Thumbnail navigation is now the recommended workflow for the use cases covered by RecentlyAdded. I also couldn't find the RecentlyAdded workflow on your Github, so now I wonder if the following workflow is possible using Thumbnail nav: type keyword matching a specific folder (scr for screenshots for folder, rdn for download folder) get a list of the files from that folder sorted by last added/updated (ideally the screenshots would use thumbnails, but the downloads would be a basic list). optionally filter the file by typing part of their name if needed action the file of my choosing Thanks in advance for the pointers.
  5. Context I am trying to create a simple workflow which outputs a list of common git commands with a basic explainer in the subtext. To import my list I created the following csv file "git config","Set configuration options such as user name and email. It's done once at the setup of git.","git config --global user.name USERNAME" "git init","Create an empty Git repository in the specified directory. Initial step to start a new project.","git init REPO_NAME" "git clone","Create a local copy of a remote repository. Necessary to start working locally on the project.","git clone REPO_URL" "git add","Add files to the staging area in preparation for a commit. Done after making changes to the working directory.","git add FILE_NAME" "git status","Display the state of the working directory and the staging area. It helps to see what changes are staged for commit.","git status" "git commit","Record changes to the repository with a message. This comes before making a pull request.","git commit -m COMMIT_MESSAGE" "git branch","List, create, or delete branches in the repository. Used to work on features or fixes in isolation.","git branch BRANCH_NAME" "git checkout","Switch between branches or restore files to the working directory. Used to switch the context.","git checkout BRANCH_NAME" "git merge","Combine changes from one branch into another. Used to integrate changes made in a branch.","git merge SOURCE_BRANCH" "git pull","Fetch from and integrate with another repository or a local branch. Keep your branch up-to-date with the remote repository.","git pull REMOTE_NAME BRANCH_NAME" "git push","Update remote references along with associated objects. Send your commits to the remote repository.","git push REMOTE_NAME BRANCH_NAME" "git log","Show the commit logs. View the history of the repository.","git log" "git stash","Temporarily save changes that you don’t want to commit immediately. Useful to clean working directory.","git stash save STASH_NAME" "git remote","Manage the set of remotes. Useful for adding remote repositories.","git remote add REMOTE_NAME REMOTE_URL" "git diff","Show changes between the working directory and the index or between two branches. Useful for reviewing code changes.","git diff SOURCE_BRANCH TARGET_BRANCH" The main output is a Copy to Clipboard action. An alternative action is a search to the https://git-scm.com website Problem My problem is that the subtext is too long, so the explanation is truncated. I was then thinking of passing the CSV to the list filter as a series of a series of arguments separated by a newline, allowing me to recapture them on output and sending them to a large type output. Is that possible somehow or do I need to switch to a script filter?
  6. Hello, I have been an avid user of your workflow for years. But I recently upgrated to MacOs 13, and the workflow stopped working. Here is what I get in the debugger: [12:38:09.440] ERROR: RecentlyAdded[Script Filter] Code 126: /Users/cedric/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/9E2D9F43-89B8-461E-ACAD-0AF96EE4D44E: line 1: ./recentlyadded: Permission denied I use the 2022.2 version. Any idea? Thanks!
  7. Hey, Just wanted to say that it works perfectly for me. Thanks so much for the workflow and its beautiful documentation. Best, OSX 10.11.5 El Capitan Macbook Air mid-2011 Alfred 3
  8. Thanks so much for the response, it's so much clearer now. A lot of things weren't obvious to me, like the part about "modelled on the requests library" meaning that it worked exactly the same way. Because I didn't understand how Alfred worked, the part of the code about grabbing the query went over my head, as I didn't understand what the code was doing. Here is why I'm using the print function: my goal with the v0.1 of the workflow was to be able to display (print) very simply the answer to the question "male or female?" I naively thought that I could write a v0.1 my Python script and easily integrate it into Alfred, and iterate from there. Obviously, there are too many hurdles in doing that, so I will: - finalise the script (by making sure my code works when the API returns errors or the like). - integrate it into Alfred by using your library Thanks for the clarification, really. I'm going to post again here when I'm done rewriting the code.
  9. I've already read it twice before posting (along with Alfred-workflow documentation and the bundler code comments and documentation, and other forum posts), I do try to do my homework before asking for help! The tutorial does not do exactly what I'm trying to do, as I'm not trying to show a list of posts. It might be why the answer didn't seem so obvious to me. But I guess I'll take a small break and re-read it again, maybe taking a step back will help seeing the answers there. Thanks a lot for your help, sorry if it seemed like I was trying to make your write the tutorial again.
  10. Thanks for the quick reply! About the error in the code I'm not sure I understand what's happening: I tested the code in iPython, and it works. I then tested the worfklow while using fixed values ('Alice Nicolas' instead of '{query}') and it works. When I'm using it with {query} it doesn't work. Here is the error message, for reference: [ERROR: alfred.workflow.action.script] Traceback (most recent call last): File "genderize.py", line 36, in <module> proba = [float(r.json()[p]['probability']) for p in range(len(values))] KeyError: 0 About passing the query I'm not sure I understand exactly how do I pass the query. In the other workflow that I wrote in bash, I knew that scrip.sh word makes 'word' a positional parameter that I can grab in the code. For python, I don't know how to tell Alfred "replace the {query} in the code with my input". I thought it was managed automatically. About the problems with the code I know that my code doesn't work if the API returns errors, I went for a first version that would allow me to test creating a working workflow in Alfred. Once i can do that, I will focus on making the code stronger. I'm a beginner at Python, so I don't have the best practices yet in regards to querying API. About alfred-wofklow It's included in the folder at the moment, but not used. I plan to review the tutorials later to see how I can adapt the code to my needs if I want to complexify the workflow. Working with requests first was a good way to learn a popular Python module that I will probably use in other projects.
  11. Thanks a lot for the tips, and especially for the aliases. pip now works as it should and I successfully installed Requests in the worfklow. I do have a message about pip not being up to date, should I try to update it? It seems to be in the system folder. That said, my workflow still does not work. I tried using the script filter, but Alfred would display fallback options (Google...) before I'm able to finish typing the names. I then tried with the other script object, but nothing happens. If you could give it a look and tell me what's wrong, that would be really helpful. Here is the link. Thanks!
  12. I'm trying to create a Python workflow that would work with the API of https://genderize.io In my Python code I use the "requests" and "collections" modules. The code works as intended when ran through the Python interpreter, but now I don't know how to actually finalize the worfklow and include the dependencies. I tried using the Python dependency bundler, but it didn't seem to work. I tried to pip install inside the workflow folder, but I have the Homebrew related bug with the pip install --target=url. I used a technique which did install requests in the workflow, but I'm not sure how to point to it now. I'm very confused despite my best efforts, and the workflow folders reflect that. Hopefully someone can walk me though the correct steps to do once the code is written and working. Thanks! Here is the workflow: link And the code: #!/usr/bin/env python # encoding: utf-8 #Code under MIT lience, modified from Stack Overflow answers, as listed below: #orlp http://stackoverflow.com/a/19560097 #Aaron Hall http://stackoverflow.com/a/33737067 #metatoaster http://stackoverflow.com/a/25480206 #Ultimate Zero http://stackoverflow.com/a/13224079 import requests from collections import OrderedDict import bundler bundler.init() #1.PREPARING THE QUERY #import Alfred's query query = '{query}' #transform query into a list values = query.split() #format the keys as expect by genderize.io keys = ['name' + '[' + str(i) + ']' for i in range(len(values))] #create the parameters as an ordered dictionary of keys and values, as expected by requests.get() names = OrderedDict([(k, v) for k, v in zip(keys, values)]) #2. SENDING THE QUERY AND FORMATTING THE RESULTS #query the API with the GET request r = requests.get('https://api.genderize.io/', params=names) #define a function to easily access probability. proba = [float(r.json()[p]['probability']) for p in range(len(values))] #define a function to easily access count. count = [int(r.json()[c]['count']) for c in range(len(values))] #define a function to easily access gender. gender = [str(r.json()[g]['gender']) for g in range(len(values))] #3. PROCESSING THE RESULTS #print the results of the query, with some variations linked to the strenght of the guess for r in range(len(values)): if proba[r] >= 0.9: print values[r], 'is most likely', gender[r] elif 0.7 <= proba[r] < 0.9: print values[r], 'is probably', gender[r] elif 0.5 < probar[r] < 0.7: print values[r], 'is maybe', gender[r] else: 'the gender of', values[r], 'is unknown'
  13. Hello, Thanks for this amazing worfklow. I'm a big pocket user (top 1% reader according to their stats) but both the mac app and the firefox extension were failing me (the firefox extension doesn't work when you don't save your history). I'm not sure how the "save link from clipboard" works though. I activated the global shortcut, but nothing much happens. How is it supposed to work? Should the link appear in alfred with the option to "save to pocket"? or does it work in the background with no feedback to the user? By the way, you should mention in the description that users have to set the global hotkey themselves; this is the normal behaviour of Alfred to avoid conflicts with other system hotkeys. Cheers
×
×
  • Create New...