Jump to content

Yaz

Member
  • Content Count

    13
  • Joined

  • Last visited

About Yaz

  • Rank
    Newbie

Recent Profile Visitors

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

  1. @kodiak I concur! Yes! This would be a good alternative to the definition showing in the Alfred panel/window (however, it might not be practical in some cases as some word definitions are multiple and long). A perfect implementation (imo) would be spotlight-like in-window scrollable definition with the option of displaying definitions from 1 or more dictionaries.
  2. @deanishe I am very new to this and would appreciate it if you could direct me where I can learn how to integrate variables from Alfred into the script. What should I look up? Is there a common method that I can learn about? Thank you!
  3. @deanishe Thank you, I always appreciate your help. I'm probably going to stick with Python 3. Is your library the only way to integrate variables from Alfred's workflow into the script?
  4. I added the workflow folder from https://www.deanishe.net/alfred-workflow/ to my workflow's local folder.
  5. First of all, this is my second time writing code. It is supposed to insert a number provided by the user (in the Alfred dialog) into a predefined cell in a predefined Excel sheet. The code worked when I ran it in Terminal (python 3.7) and on Anaconda (python 3.7). When I tried running it in Terminal on usr/bin/python (python 2.7) it couldn't import the module/library (https://pypi.org/project/openpyxl/). However, I thought by downloading the package, moving it to the workflow's local folder, and running it on Alfred the issue will be solved. It didn't work and I received this error on debugging (replacing the path seen in the 4th line with PATH in the rest of the lines): This is the code: #!/usr/bin/python # encoding: utf-8 import sys import os from workflow import Workflow from workflow import Variables from openpyxl import load_workbook v = os.getenv('questions') path = '/Users/Yaz/Desktop/Schedule.xlsx' wb = load_workbook(filename = path) sheet = wb['Sheet1'] sheet['I1'].value = v wb.save(path) The workflow starts with a "Keyword" object that requires an argument (the number) connected to an "Arg and Vars" ,which assigns the name "questions" to the {query}, connected to a "Run Script" action (/bin/bash) with "/usr/bin/python excel.py "{var:questions}" as the script. I have Alfred 4.1 running on macOS Mojave.
  6. @deanishe Oh, I see. Yeah I was confused when it opened finder instead of spotlight so I agree with your last point. Thanks man!
  7. @deanishe My bad. I just figured it out but I will share the workflow in case anyone would find it useful (the replace empty input utility solved my issue). https://ufile.io/7uilohmi Thanks again deanishe!
  8. I am trying to make a workflow that opens Youtube (https://www.youtube.com/feed/trending?gl=US) if no argument is passed and searches YouTube if an argument (selection in macOS is passed). I tried using the conditional utility but it seems that a value (not zero) is passed when there is no argument. I tried debugging to see what value is given when no argument is passed, but it only shows "" in the debugger. What am I doing wrong? Or is there another workaround? Thanks
  9. I use Alfred for almost everything except when I look up word definitions because of the useless layout that Alfred provides (without opening the dictionary app). If this was implemented, another useful feature would be the option to set up the dictionary as a fallback search if the word is in the dictionary (like Spotlight).
  10. Title explains it all. I have checked and enabled all requested permissions. It is worthy to note that I have changed Alfreds hotkey to cmd-space and Spotlights to alt-space. Does anyone have an idea of whats going on and how I can fix it? Thanks
  11. Some of my hotkeys are the same as the key combinations to special characters such as alt-X which gives (≈). So having an option to toggle all workflows (or better only ones that are currently enabled) enabled/disabled with a keyword or a hotkey would be a useful and time saving feature (instead of manually looking for the workflow disabling it and then enabling it back when I'm done).
  12. Thank you so much! It finally worked after my many failing attempts to convert it to python 2. P.s. Alfred is absolutely my favorite app on my Mac. It really is an essential app for productivity and it complements MacOS perfectly. I really appreciate your work!
  13. Hello. I wrote this code for python 3 before discovering that it is not supported by Alfred. Ever since, I have failed to convert it to python 2 and to be able to incorporate it in a workflow. This is the original script that was working just fine: #!/Users/Me/anaconda3/bin/python import feedparser d = feedparser.parse('https://www.aliftaa.jo/PrayTimes.ashx') print(d['entries'][0]['title']) print(d['entries'][1]['title']) print(d['entries'][2]['title']) print(d['entries'][3]['title']) print(d['entries'][4]['title']) print(d['entries'][5]['title']) I changed the shebang to (#!/usr/bin/python) and removed the parentheses in the print functions. However when I run it in terminal (using python2) it says that "list index out of range" and in python launcher 2.7 "No module named feedparser". I'm not experienced with programming so I have been struggling to figure it out on my own but I have failed to do so for the couple past days. Any help is deeply appreciated! Edit: I installed feedparser in the python 2.7 directory and it imports normally in terminal.
×
×
  • Create New...