Jump to content

Jenner36

Member
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Jenner36

  1. Hi, I have build a simple password manager, in the below python file, however i can't set it to the clipboard when i run the file. but my basic question is how to print a string from a python file, when running a workflow, with a python script How do i do that? Best Regards Jens def main(): result = str(reduce(go, range(20), '')) # an example of the print would be ;691i1A3ny`92+"7ltB9% print(result, end='') if __name__ == '__main__': try: sys.exit(main()) except Exception as err: #from traceback import format_exc # log traceback to Alfred's debugger #log('[ERROR] %s', format_exc()) # show error message in notification #notify('Execution Failed', str(err), True) sys.exit(print("error"))
  2. Hi, I am currently using freedom through the exam period, however I find it tedious continously turning it on. 1) Dragging my mouse to the top bar 2) Clicking Freedom Icon 3) Clicking Start Session 4) Clicking Last used session Is it possible to write a script / make a workflow for to this? The app / software: https://freedom.to/
  3. I am sorry for the late answer. But I can see you solved the issue - thank you very much. I'll read through your code, just through skimming it I can see I have a lot to learn. As my title here in the forum I am a newbie so I greatly appreciate you taking the time!
  4. I've put the file in here , which it runs https://we.tl/t-6BmT6UIzAd
  5. My Worklflow calls a Keyboard Maestro macro to use regular expression. I am also having difficulties with using regex in Alfred. However here is a basic version, I am working on building it better https://we.tl/t-oBqLnRMPNd
  6. Hi, [Objective] I am trying to build a workflow which gets a DOI link [e.g. https://doi.org/10.1287/orsc.3.3.398] and sets my clipboard to some text from a pulled JSON file. In this case (Orlikowski, 1992). However, I am having a hard time importing the query from Alfred in to the file, and getting it back. I have written the python script, lack the means to use the file. I have made the beginning of the workflow, using regex to focus on the link I need (e.g. 10.1287/orsc.3.3.398) with the regex key - (\/\d{2}.\d{4}\/\w.*), def main(): urlData = "https://api.crossref.org/works/" # the query should be inserted on line 44 urlData += "10.1287/orsc.3.3.398" # Open the URL and read the data webUrl = urllib.request.urlopen(urlData) print ("result code: " + str(webUrl.getcode())) if (webUrl.getcode() == 200): data = webUrl.read() # print out our customized results, but should set this to clipboard print(printResults(data)) else: print ("Received an error from server, cannot retrieve results " + str(webUrl.getcode()))
×
×
  • Create New...