Jump to content

heyJoeCampbell

Member
  • Posts

    56
  • Joined

  • Last visited

Reputation Activity

  1. Like
    heyJoeCampbell got a reaction from GatorMapi in Open url with multiple queries   
    Thanks @CJK but what I am looking for is a way to add multiple variables into one URL
     
    website.com/{query1}/blah/{query2}
     
    I do not code - I need a plug & play workflow that I can mod ?
     
    This thread from 2014 looks promising:
     
  2. Like
    heyJoeCampbell got a reaction from vitor in Rename Action — Rename files and folders   
    Understood - and I apologize for tiptoeing.
  3. Like
    heyJoeCampbell reacted to deanishe in Add "copy file" in file action   
    I had a dig through some old, similar scripts and came up with this. It will work as a command-line script or pasted into the Script box of an Alfred Run Script action (set Language to Python).
     
    #!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2016 deanishe@deanishe.net # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2016-01-11 # """ Copy files to OS X clipboard. Works as CLI script or Alfred File Action script. """ from __future__ import print_function, absolute_import import os import sys from AppKit import NSPasteboard from Foundation import NSURL def paths2urls(paths): """Convert `paths` into a list of NSURLs. Args: paths (list): Absolute filepaths. Returns: list: List of NSURL objects corresponding to `paths`. """ urls = [] for p in paths: p = unicode(p, 'utf-8') url = NSURL.fileURLWithPath_(p) urls.append(url) return urls def copy2pasteboard(items): """Place `items` on the general pasteboard. `items` *must* contain NSURLs. Args: items (list): List of NSURL objects. """ pb = NSPasteboard.generalPasteboard() pb.clearContents() pb.writeObjects_(items) def filepaths_from_argv(): """Read filepaths from command-line arguments. Returns: list: Absolute paths read from ARGV. """ return [os.path.abspath(p) for p in sys.argv[1:] if os.path.exists(p)] def filepaths_from_alfred(): """Return filepaths based on Alfred's { query } text macro. Parse Alfred's tab-separated list of paths. Returns: list: Absolute paths passed by Alfred. """ filepaths = "{query}".split('\t') filepaths = [f for f in filepaths if f.strip() and os.path.exists(f)] return filepaths def main(): """Run script.""" if os.getenv('alfred_version'): # Running in Alfred filepaths = filepaths_from_alfred() else: # Assume CLI filepaths = filepaths_from_argv() urls = paths2urls(filepaths) copy2pasteboard(urls) if __name__ == '__main__': main() Just attach this to a File Action (it works with multiple files).
  4. Like
    heyJoeCampbell reacted to jdfwarrior in Recommendations for Sharing Workflows   
    Recommendations for Sharing Workflows
     
    The forums have really been running well and you guys (and gals) have been creating some amazing workflows so far. I wanted to throw out a few suggestions though to make sure things stay organized, are easy to read, and easy to find.
     
    This will be an evolving document. Check back for questions regarding questions on posting your workflows. If you have a question that isn't answered within the contents of this thread, feel free to contact any of the moderators (Myself, Andrew, or Vero). 
     
    Post Titles
    Be specific. Don't be overly descriptive about every little feature the workflow provides. Titles are best kept to the workflow name, and potentially a few words on the overall gist of what it does.
     
    Tags
    Be sure to set topic tags for your workflow post. This will make it easier for users searching on the forums to find your post/workflow easily based off of a few key words.
     
    Dependencies
    Please include a listing of all dependencies for your workflow. This will hopefully alleviate potential problems that users run into from attempting to run an installed workflow without an installed package being present. Examples of this would be Ruby gems or Python modules or even Python versions that are required for using the workflow. If a specific application is required for your workflow to function, be sure to include a link to that applications website, or a link to it in the App Store as well. Also include, if necessary, required versions of OS X.
     
    System Modifications
    If your workflow creates or modifies any supporting files that would alter the users environment, this should be noted. This will make it known up front that your workflow modifies system file X to achieve its functionality. Also, if the user uninstalls the workflow, how to remove these files or restore the originals.
     
    Screenshots
    They aren't required, but providing a screenshot or two for your workflow helps provide users with a good idea of what it is they are about to download. Descriptions help, but many users are wanting to pop in, get a quick visual, and download.
     
    Posting
    When sharing a new workflow, please be sure to create your own thread for it. By posting it in another workflows thread, your workflow may never reach the masses. Create your own thread so that it stands out and everyone will be able to find it easily. This helps remove confusion on which workflow to download if there are multiple workflows, or modified workflows posted within the same thread. It also helps ensure that the develop that spent their time and put in the hard work to create the workflow get credit for their work. Posting a patch/update/fix/modified version of a workflow in another authors thread may steal attention from their original work. So let's try to be considerate.
     
    Sharing Multiple Workflows
    Try to limit a new thread to a single workflow. The reason for this follows the situation mentioned above. Unless you have an abnormally long title, users casually browsing the forums may not realize how many workflows are available in the post, or what they are. Creating a separate post for workflows also creates an individual area for you to provide support or answer questions for that workflow alone.
     
    Modifying Existing Workflows
    Most developers are very open to feature requests for their published workflows. So before modifying someone else's workflows, check with the developer and see if they would add the feature first. If the requested feature is something that the developer doesn't plan on adding, of course you could add the feature yourself. If you think it's a feature that others would also find greatly useful and you decide that you would like to share your modified version, please be respectful of the original developer give them a heads up before hand. Also, be courteous and give credit to the original author and/or a link back to their original thread so that they receive some credit for their work. Nobody enjoys having their work stolen.
     
    Updating You Workflows
    When sharing an update to an already posted workflow, rather than creating another post in the existing thread, update the initial post to include desired information and updated download links (if necessary). This makes it easier for users to find the most up to date version of your workflows, along with information what is included in the update. You could also modify the thread title to indicate the date that the workflow was last updated.
     
     
    Notice: I'm also going to try to monitor this thread and keep it clean. If you post suggestions for other things to be added to the document, if they are merged in, I will probably remove your original post. Questions will also be treated the same way. If answers are later added into the original post, I may remove the original question. This will hopefully keep it so that all documentation remains in the original post so someone doesn't potentially have to search through several pages of questions for find a simple answer.
×
×
  • Create New...