Jump to content

smarg19

Member
  • Posts

    505
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by smarg19

  1. Unfortunately, the problem lies in a 3rd party utility. I think it might be broken. Try this and if it doesn't work, I'll post an update to avoid that 3rd party utility. So, try going to /Users/mikelduffy/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries. Delete this alfred.bundler-aries directory. Then try to run the z:config again and tell me what happens. Hopefully alfred.bundler will reinstall itself and fix the problem. If it doesn't, I'll post a fix.
  2. UPDATE - on Packal Version 1.2 now also supports the snippet syntax used by Brett Terpstra's EZSnippets script. This means that you can write text in either the Alfred-Snippets manner (where you are thinking of the snippet first, and defining it later), or in the EZSnippets way (where you write the expanded version first, then give it a snippet), or even mix and match both as you are writing. You still use the snip keyword to select your text and convert it. It's still fast, but it should be better than ever, since no doubt Brett's audience is bigger than mine. Enjoy the on-the-fly snippets everyone, stephen
  3. I know. I'm flattered. I'm happy to know I'm not the only person who thinks this type of thing is helpful. Since he has such a big audience, I'll probably go ahead and add support for his syntax as well. I'll need to get on that.
  4. "break" is such a strong word. I prefer "points out areas for improvement" Couldn't agree more But honestly, I "watch" the development on GitHub, and this will be solid when you all release it and a great boon to Alfred workflows. I honestly feel that we (mostly y'all) are turning Alfred into an amazing mini-platform for software development. I have to find anything with this subtle balance between ease and simplicity of creation as well as complexity and power of performance. With the Bundler, that will go to another level. We will truly be able to build basically our own little apps that run on top of the Alfred platform. That is crazy power, yet so simple as well. This is great stuff. Keep up the good work!
  5. Version 1.0.4 fixes a critical bug introduced in 1.0.3. Please upgrade.
  6. Thanks. I'll wait for Taurus then and just put the drops in the workflow for now.
  7. UPDATE: Version 1.0.3 now bundles all dependencies with the workflow itself, obviating the need for the bundler. This avoids potential problems with that 3rd party utility. Please update via Packal
  8. I am using this for Pandoctor and a user just reported this error. Any help or suggestions? [ERROR: alfred.workflow.action.script] Code 1: [aries.zip] End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of aries.zip or aries.zip.zip, and cannot find aries.zip.ZIP, period. mv: rename alfred-bundler-aries/* to /Users/stephan/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries/*: No such file or directory [terminal-notifier.zip] End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of terminal-notifier.zip or terminal-notifier.zip.zip, and cannot find terminal-notifier.zip.ZIP, period. cp: terminal-notifier.app: No such file or directory /Users/stephan/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/alfred.bundler-aries/installer/installer.sh: line 63: /Users/stephan/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries/assets/utility/terminal-notifier/default/terminal-notifier.app/Contents/MacOS/terminal-notifier: No such file or directory /Users/stephan/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries/assets/python/net.deanishe.alfred-python-bundler/bundlerwrapper.sh: line 76: /Users/stephan/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries/bundler.sh: No such file or directory /Users/stephan/Library/Application Support/Alfred 2/Workflow Data/alfred.bundler-aries/assets/python/net.deanishe.alfred-python-bundler/bundlerwrapper.sh: line 49: __loadAsset: command not found
  9. UPDATE Version 1.0.2 fixes a small bug with user template commands. Download/upgrade from Packal. stephen
  10. That's wonderful. Thank you. I'm sorry that I failed to update in a timely fashion. For everyone else, I have just pushed Version 3.1 to Packal. Please update. It fixes the Unicode bug. You can now have Unicode for both enmd and mden commands. Also, I have added the ability for Wikify to automatically select all and copy your text when you run the mden command.
  11. UPDATE I've updated to version 1.0.1 with a fix for pdf output. The original version didn't have pdf as an output option. Now it does. NOTE, however, that you have to have LaTeX installed for pdf output to work.
  12. Pandoctor An Alfred GUI for Pandoc Version: 1.0.5 Download from Packal View on GitHub Read a slightly fuller version on my blog Introduction Pandoctor is a relatively simple, easy-to-use way to bring the high-powered functionality of Pandoc to you. For those new to Pandoc, Pandoc is "the universal document converter". It is an amazingly powerful utility that allows you to convert structured text from a ton of possible input formats to an even larger number of output formats. A potential downside to Pandoc, however, for many users is that it is entirely a command line utility. This means, on the Mac, you have to open Terminal to use it. For many Mac/Alfred users, this is at least slightly daunting. Yet I believe that this should not be a deterrent to more people coming to use the power of Pandoc. This is the reason for Pandoctor. Now, Alfred users can enjoy the comfortability and familiarity of the Alfred interface to manage Pandoc. Here's how: Pandoctor is accessed via File Actions. The basic file action is "New Pandoc Conversion", which will kick off a series of interactive Alfred menus to create your Pandoc conversion. Once you have chosen the file you want to convert and selected the file action, Pandoctor works in 4 stages: specify the text format of the chosen file chose the output format you want for the converted file chose any options you want for the conversion process run Pandoc to convert the input file using your chosen options Luckily, Pandoctor is built to move you through these four steps seamlessly and without any interaction on your part aside from selecting and setting the formats and options you want. Let's walk through the steps.Configuration When you first download Pandoctor, you will need to configure a few settings. Luckily, Pandoctor takes care of this for you. All you need to do is use the dr:config keyword to get everything set up. Once you see the completion notification, you can start using Pandoctor for real. Running a new Pandoc Conversion Using the File Action If you've configured, you begin Pandoctor by using Alfred's file navigation abilities to find the file you want Pandoc to convert for you. Once you've found the file, enter Alfred's File Actions pane for that file (by default this is →). Then find Pandoctor's "New Pandoc Conversion" file action: > Selecting the Input Format This tells Pandoctor to begin a new conversion on that file. Once you select "New Pandoc Conversion", Pandoctor will automatically ask you to choose the format of this input file: > Pandoctor tries to be smart about formatting, so it will pre-fill the search bar with what it believes to be the file's formatting. However, if you need to, you can simply delete this and start searching yourself. You will see that Pandoctor displays the full name of the input format as well as a short description to help you discern between similar formats (such as the 4 types of Markdown Pandoc accepts). Selecting the Output Format When you choose the input format, Pandoctor will then automatically ask you to select what format you want the outputted, converted file to be: > You have access to the full range of possible output formats from this selection. You can use the arrow keys to navigate down, or start searching for your desired output format by name: Selecting any Options As soon as you select the output format, Pandoctor will ask you what Options you want to add to this Pandoc conversion: > Pandoctor UI There are a few elements to the UI that require more explanation. First, you see that some items have the inner rectangle filled, and others do not. This is your visual cue to determine which options are active for this conversion (filled) and which are not (empty). Pandoctor Default Options When you first come to this "screen" or "window" (not sure what to call individual Alfred windows/pop-ups), you will see that some options are already filled, even though you didn't select them. These are Pandoctor's Default Options. The file (pandoc_defaults.json) specifying which options are by default always on (filled) can be found inside the workflow's folder (if you need to open this folder, you can do so easily using the dr:help keyword and selecting Root). This file also has comments for most options, which gives some information about them (Obviously, for detailed information about Pandoc's options, visit the User Guide). When installed, Pandoctor has 4 default options on: parse-rawDescription: "Parse untranslatable HTML codes and LaTeX environments as raw HTML or LaTeX, instead of ignoring them." smartDescription: "Produce typographically correct output, converting straight quotes to curly quotes, --- to em-dashes, -- to en-dashes, and ... to ellipses." normalizeDescription: "Normalize the document after reading: merge adjacent Str or Emph elements, for example, and remove repeated Spaces." standaloneDescription: "Produce output with an appropriate header and footer (e.g. a standalone HTML, LaTeX, or RTF file, not a fragment)." User Default OptionsIf you want to set your own default options (overriding these), you can use the dr:defs keyword. This will provide a "window" similar to the standard Options window, but without anything selected. Here select whatever items you want to be on by default for any new conversion. Selecting any Options, pt. 2 Back to the Options Selection, tho. You will also see that that there are 2 basic types of options: Boolean Argument Selecting Boolean OptionsIf you select a Boolean option, it will simply "turn on" (the rectangle will be filled) and this screen will refresh. For example, here's this screen right before I choose to "turn on" the strict option: > and here's what the screen looks like as soon as it refreshes after I selected that option: > Selecting Argument Options So, "turning on" Boolean options is simple. Argument options, however, require a bit more work. As the name suggests, this type of option requires more information (an "argument"). (Again, if any of this is confusing, I would highly recommend reading through Pandoc's User Guide). This means that you will need to tell Pandoctor what you want the "argument", the information, to be. So, whenever you select an Argument option, you are taken to an intermediary "screen" where you can supply the needed information. For example, if I were to select the toc-depth argument option, I would then fill in the information (I want the Table of Contents in the converted file to only go 4 levels deep): > Once you fill in the information, press return (i.e. "Set argument value of chosen option") and return to the base Options "screen". Finalizing Options Now, as soon as you have set all of the options you need, you only need to select the top item on this "screen": Done setting Options?. This will close this screen. As I've noted before, if you instead select an option, this screen will merely refresh. Pandoctor UI, pt. 2 A small UI note: there is always a "header" for every list that Pandoctor displays. However, there are 2 different kinds of headers: informational and non-selectable interrogative and selectable The purely informational headers have the little i in the center. These headers are found when selecting input and output formats. They cannot be selected; they simply tell you what that "screen" is. The interrogative headers, however, can be selected. These have the ? in the center. You will use these to "close" the screen you are viewing.Running your Pandoc Conversion Returning to the flow of the conversion, you have just finished selecting all of the options for your Pandoc conversion. As soon as you hit Done setting Options?, Pandoctor will begin processing the conversion. This process can take a bit of time (particularly when generating PDFs), but when it is complete, you will see a notification in the top right of your screen: That's all there is to it really. In 4 simple steps, you can convert just about anything. However, for those more inclined toward "power-use", there are a few other abilities under Pandoctor's hood. Ignoring Options First off, Pandoctor offers the ability to "hide" or "ignore" certain options in the Select Options screen. Pandoc itself offers a lot of options, and always seeing them all is often unnecessary. If there are any options that you never use, you can simply remove them. To do this, you need to use the dr:ignore keyword. This will bring up a "screen" almost identical to the Select Options screen, but here you are choosing what options are hidden from that other screen. Once again, the two icons are informative. If an item is filled in, this means that it is going to be ignored: > Otherwise (not filled in), it will appear in the standard Select Options window: > As with the basic window, you can search here or just use the arrow keys. Select all of the options you want to ignore, and when you are done, select Done setting Ignore? to exit. Template Commands For those who use Pandoc frequently, you will likely use the same basic command over and over again. If that's the case, Pandoctor has a "power-user" feature just for you. In addition to the "on-the-fly" conversion available via the "New Pandoc Conversion" file action, Pandoctor also hase a "Templated Pandoc Conversion" file action: > This action grants you access to any and all Pandoc template commands you have set up. Before I detail how to create a new template, let's briefly discuss the elements of a template. Pandoctor ships with a file in the workflow directory that has some sample templates. This file is titled pandoc_templates.json. If you open this file in your text editor of choice, it will look just like this: Sample Templates /* PANDOC TEMPLATED COMMANDS The [font=courier new,courier,monospace][/font]defaults[font=courier new,courier,monospace][/font], at initiation the [font=courier new,courier,monospace]parse-raw[/font], [font=courier new,courier,monospace]smart[/font], [font=courier new,courier,monospace]normalize[/font], and [font=courier new,courier,monospace]standalone[/font] options, are found at [font=courier new,courier,monospace][/font]pandoc_defaults.json[font=courier new,courier,monospace][/font]. HOW TO CREATE TEMPLATE: + take your CLI pandoc command (e.g. "pandoc -s -S --toc -c pandoc.css -A footer.html README -o example3.html") + convert all "short option + space + argument" to "long option + '=' + argument" (e.g. "pandoc -s -S --toc --css=pandoc.css --include-after-body=footer.html README --output=example3.html") + split all options into list of individual options (e.g. [pandoc, -s, -S, --toc, --css=pandoc.css, --include-after-body=footer.html, README, --output=example3.html]) + remove initial call to [font=courier new,courier,monospace]pandoc[/font] and replace input text path with [font=courier new,courier,monospace][/font]{input}[font=courier new,courier,monospace][/font] variable (e.g. [-s, -S, --toc, --css=pandoc.css, --include-after-body=footer.html, {input}, --output={input}.html]) + make sure every option is a JSON string (e.g. ["-s", "-S", "--toc", "--css=pandoc.css", "--include-after-body=footer.html", "{input}", "--output={input}.html"]) + give it a memorable name + determine if you want to automatically add your default options to the command or not. In order to make your templates more extensible, you can use any of 3 built-in variables that relate to the file chosen to convert: * {input_file} = The full path to the file, including file extension * {input_name} = The full path to the file, without file extension * {input_dir} = The full path to the parent directory of the file For example, this template would only work if you kept a project directory that contained both [font=courier new,courier,monospace]biblio.bib[/font] and [font=courier new,courier,monospace]chicago-author-date.csl[/font] alongside your input file. { "name": "Biblio Test", "use_defaults": false, "options": [ "-s", "-S", "--biblio={input_dir}/biblio.bib", "--csl={input_dir}/chicago-author-date.csl", "{input_file}", "--output={input_name}.html" ] } */ [ { "name": "XeLaTeX PDF", "use_defaults": true, "options": [ "-N", "--variable=mainfont:Georgia", "--variable=sansfont:Arial", "--variable=monofont:\"Andale Mono\"", "--variable=fontsize:12pt", "{input_file}", "--latex-engine=xelatex", "--toc", "--output={input_name}.pdf" ] }, { "name": "Pandoc MD -> HTML", "use_defaults": true, "options": [ "--toc", "--css=pandoc.css", "{input_file}", "--output={input_name}.html" ] } ] Template ElementsAs you can see, it comes with two "default" templates, as well as one commented-out template. These are there to help you see the format of the JSON as well as Pandoctor's unique features. As the default templates show, each template must have 3 keys: name use_defaults options The type of value for each of these is fixed. For name, you must use a string; for use_defaults, you use a Boolean (either true or false); and for options, you use a list/array of strings. The name parameter is simple; this is the name of your template (what will be displayed when you are asked to choose which template you want to use). The use_defaults parameter is fairly self-explanatory as well; do you want to automatically add the default options to this command or not? It is the options parameter where the magic happens, and this is the one that requires the most precision.As the comments in the file will tell you, you need to properly format your Pandoc command for use as a Pandoctor template. This means, each option is its own item in the list and each option is without spaces (unless properly quoted). This will require you to use the "long" version of any option along with the an equals [=]. The 3 given examples give thorough demonstration of what acceptable templates can look like. Template Variables In addition to these formatting requirements, Pandoctor also gives you the ability to abstract your template properly. For any template, you have access to 3 variables: {input_file} = The full path to the file, including file extension {input_name} = The full path to the file, without file extension {input_dir} = The full path to the parent directory of the file These variables will allow you to properly use your template with any conversion. You will see that every template should use {input_file} and {input_name} for the input and output options respectively. In addition, if you specify any outside resource files, you can then use {input_dir} to ensure that the full path is properly constructed (see the "Biblio Test" example in the comments).Running a Template Command Once you set up a template, it will make using Pandoc so much easier. All you have to do is select the file in Alfred's file navigator, choose the "Templated Pandoc Conversion" file action, and then choose which template you want to use. That's it. > As with the New Conversion, the process takes a variable amount of time. Whenever the conversion does finish, however, you will see a notification in the top right of your screen: > Creating a Template So, how do you set up template commands? As the Template Elements section describes, each template requires 3 things. So, in order to create a new template, you will need to create each of these 3 elements. Hopefully, however, Pandoctor makes this dead-simple to do. To begin creating a new template, use the dr:temp:set keyword. Setting Template Name Type the keyword and then press return. This will immediately jump you to assigning a name for your new template. To assign a name, simply type the name of the template. As seen in the screenshot above, this name will be all that you will see in the Script Filter to choose which template you want to run. As an example, I created a new template called "Template Test": > Setting Template Defaults Once you finish typing your template name, hit return and Pandoctor will then automatically ask you if you want your Default Options to always be added to the template command: > If you select True, this means that whatever options your template command has, your assigned Default Options will be added to the final Pandoc command. For example, if you have set standalone to be a Default Option, regardless of whether or not you have that option in your template command, Pandoc will still create a standalong document. If, however, you select False, only the options you have in the template will be run through Pandoc. Setting Template Command The final element you need to add to create your new template is, of course, the actual Pandoc command. As the section above described, Pandoctor requires your template command options to be in a very specific format. However, must Pandoc users don't actually type commands into Terminal in this format. In order to make Pandoctor as simple as possible, I have written a script that will convert the standard, short-form Pandoc command into the long-form Pandoctor compliant format. This means that all you have to do is copy your command from Terminal and paste it into this field: > As it is currently implemented, there is the possibility of some bugs in the conversion process. This means it is in your best interest to double check the user_templates.json file in your workflow storage folder (you can open this folder easily using the dr:help keyword and selecting Storage). Ensure that the variables are properly used. Also ensure that the all of the short-form options where correctly translated into their long-form version. Remember, you can use the pandoc_templates.json file as a guide for the template JSON format. I think that Pandoctor has a lot of power, and I hope it proves useful to you. For example, I wrote this entire README in Markdown and generated an HTML file using Pandoctor. If you have any problems, please let me know. stephen The Hackademic
  13. UPDATE Inspired by @dfay, I've added some functionality for Version 1.1. Downloand or update from Packal.
  14. Good tweaks. I actually have a TextExpander snippet for the snippet dictionary creation. You are correct tho, Snippets allows for multiple dictionaries. In fact, there are two possible types: single item ^^^key: value^^^ multiple items ^^^ key1: value1 key2: value2 ^^^ And you can mix and match in whatever way is simplest in the moment. You are correct about the how it manages conflicts. There's really no simple way around this tho.I love the idea of adding the dictionary creation to the workflow itself tho. I'm going to "steal" that idea The other addition makes sense too. I actually think that I should split the keyboard shortcut from the keyword. Then this would work seamlessly. As it stands, if I added those lines to the single Run Script and you use the keyboard shortcut, things will get a bit odd (and slower). So, all that to say, let me throw together a 1.1 stephen
  15. Just for clarity's sake, this workflow is simply a standalone implementation of functionality that I first made for my Wikify workflow. If you are a user of Evernote, that workflow will likely prove much more helpful for you. It has the ability to automatically hyperlink to any pre-existing Evernote notes as well as a few other gems. However, I found this feature so helpful, even when writing things that wouldn't end up in Evernote, that I created this stand-alone version as well.
  16. Snippets Simple, document-specific text snippets Version: 1.2 Download on Packal Have you ever been taking notes and realized that certain terms or phrases were going to be used repeatedly? You don't have the time or really the desire to create all new TextExpander snippets for these terms or phrases, but you'd also really like to shorten your typing. That's where Snippets comes in. Snippets is a dead simple Alfred workflow that allows you to use simple snippet syntax while writing, and then seamlessly convert your text to its full glory. The set-up is simple. As you're typing, and you realize you want to make a snippet, simply prepend your snippet with ,, (comma comma). Then, when you get a free moment, create a "snippet dictionary" to tell Snippets what that snippet means. To create the dictionary, simply wrap it in ^^^ (triple carets). Here's an example: This is an example of ,,sn. ,,sn is a fantastic workflow for ,,a! ^^^ sn: `Snippets` a: Alfred ^^^ That's all there is to it. Once your dictionary is complete and you have finished typing, either copy the text to the clipboard and use the keyword snip, or assign a keyboard shortcut for even quicker results. When you activate Snippets, the text above will instantly become: This is an example of `Snippets`. `Snippets` is a fantastic workflow for Alfred! It's so simple. Double-comma before the snippet; dictionary wrapped in triple-carets with snippet: expanded. Nothing more, nothing less.Hope this helps, stephen GitHub page: https://github.com/smargh/alfred_snippets
  17. For reference, here is what page 2 of the Help PDF needs to look basically like (with different colors and text). Note that the numbers at the beginning of the Text Notes are **KEY**.
  18. It looks like the annotations didn't survive with the export of the workflow. I had skimmer_config_new_embed in the folder for some tests. You have to modify skimmer_config_new in Skim to set the Highlight Colors. Cannot do it in Acrobat. It appears that since Skim annotations are extended attributes, they won't make it thru the uploading and importing that Alfred does. So, you are going to have to make your own version of the Config page 2. In order to get things working for now, you will need to annotate the Help PDF yourself. Highlight the six "Highlights" with your preferred colors. Then create 6 Text Notes. For each note, number it (1 thru 6 followed by a period [.] and a space) and then give the text you want for that color. Simply ensure that it looks like the image in the post above.
  19. What does the debugger say when you try to export Skim notes?
  20. This is all helpful information. Clearly not a bug per se but knowledge that could easily be of use to others. Thank you Dean for the answer.
  21. Ok, I'm not 100% clear on exactly what the problem is, so I'm going to attempt to describe what happens in a number of related scenarios. Hopefully this will suffice. In short, I am having a problem when I try to run a CLI-based program (pandoc) from a Python script which is told to run in a Run Script action. Here's the long version: I have a workflow that calls to a Python script (pandoctor.py) which itself uses the subprocess module to call the pandoc CLI. pandoc (in this instance) is using a dependency (xelatex). Whenever I use the Run Script action, I get the error from pandoc that "pandoc: xelatex not found. xelatex is needed for pdf output." To me, this suggests that the Alfred call to run pandoctor.py runs well the pandoctor.py call to run pandoc runs well but, pandoc's call to xelatex is broken Now, I believe that this issue revolves around how PATH is handled and passed between script because this same code will work if I just run the pandoctor.py script itself (with the appropriate arguments) and if I open Terminal and run the code that I have in the Run Script action (e.g. `python pandoctory.py run "{query}" (tho of course in Terminal I manually input the query)). I am assuming that Alfred has a somewhat different environment than the Terminal, with a different PATH, and this is why pandoc cannot find xelatex. So, I have questions: is there a difference in Terminal and Alfred's Run Script environment? if so, what exactly is it? how can I fix my workflow to work properly within Alfred's environment? NOTE: I am on the latest build of Alfred (2.3 264)
  22. LibGen Search and Download PDFs and Ebooks from the Library Genesis project Version 1.1 Download or upgrade from Packal. This is a relatively simple workflow that allows users to search the Library Genesis PDF repository. This workflow has only one keyword and one action. Use the keyword libgen to begin a search. Select an item and press Return to begin a download of the file in your browser of choice. The only real oddity of this workflow is that it requires the user to type a period (.) after the query in order to initiate the search. This helps with performance. Hopefully this will prove helpful for someone other than myself, stephen
  23. This is simplistic, but you can simply create multiple keywords that all lead to the same Action. Obviously, this isn't optimal, but I've used it in workflows to have "long" and "short" keywords for the same action.
  24. You cannot dynamically change the arg. Instead, pass both possible args and then split on the Action side and use whichever one relates to the mod key.
  25. All of these sound great, but I have to up-vote these two in particular. These would GREATLY simplify a few of my workflows.
×
×
  • Create New...