Jump to content

jeremycherfas

Member
  • Posts

    34
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by jeremycherfas

  1. Thanks Vitor. That's the kind of encouragement I was hoping for. I'll give it a try.
  2. I have started to use Bike Outliner to, er, outline and there are a couple of Keyboard Maestro macros that make it possible to export from Bike to Markdown and import from Markdown to Bike. These are pretty complicated (to me), but it seems that the bulk of it is running Javascript. I know Alfred can run Javascript, so could I copy the Javascript alone to Alfred and trigger that? Any guidance to how to adapt KM to Alfred gratefully received. Thanks
  3. alfred-smartify-quotes is a very simple Workflow I made to meet a very personal need. It takes selected text and transforms straight quotes into curly, smart, typographical quotes. It also converts two hyphens into an em dash. For me, the replacement text is pasted straight back over the selected text,. You can change that behaviour in the Copy to Clipboard block. I hope someone else finds it useful. Direct download. Jeremy
  4. I made a simple workflow to scratch a personal itch, using Python3 to convert straight quotes to typographical (smart) quotes. (The reverse is easy to find.) I suppose other people may find it useful too. Never having shared a workflow, although I read the introductory thread, I'd like advice on how best to host the workflow and how to create a unique bundle id. Is Github a good place to host the workflow? Or is it better to host on my own website? Thanks Jeremy
  5. I may be missing the point here, but if you are going to type the integer then / then another integer, why not invoke Alfred and type = first? That opens Alfred as a calculator which evaluates whatever you typed and puts it in the clipboard, ready to paste wherever you were at the time. I must be missing the point. Jeremy
  6. Thank you very much. After a couple of tries, that now works perfectly.
  7. Trying to create a file action trigger to rename a file by removing a suffix completely. I'm not sure how to share the actual workflow. Attach files does not permit me to upload the workflow. The filename is of the form "/Users/jeremycherfas/Dropbox/jcn-logs/forno-logs/access.log.2022-04-03" {var:filename} is set to {query} I use a regex to remove the final part and copy the result "/Users/jeremycherfas/Dropbox/jcn-logs/forno-logs/access.log" to the clipboard. I pass the clipboard to Run Script bin/zsh containing mv "{var:filename}" "{clipboard}" I get an error "No such file or directory" I'm sure this is something silly, but I cannot figure it out. Debug output: ``` [20:54:36.938] Remove date[File Action] Processing complete [20:54:36.944] Remove date[File Action] Passing output '/Users/jeremycherfas/Dropbox/jcn-logs/forno-logs/access.log.2022-04-03' to Replace [20:54:36.945] Remove date[Replace] Processing complete [20:54:36.946] Remove date[Replace] Passing output '/Users/jeremycherfas/Dropbox/jcn-logs/forno-logs/access.log' to Copy to Clipboard [20:54:36.946] Remove date[Copy to Clipboard] Processing complete [20:54:36.947] Remove date[Copy to Clipboard] Passing output '/Users/jeremycherfas/Dropbox/jcn-logs/forno-logs/access.log' to Run Script [20:54:36.961] ERROR: Remove date[Run Script] mv: rename {var:filename} to {clipboard}: No such file or directory [20:54:36.966] Remove date[Run Script] Processing complete [20:54:36.967] Remove date[Run Script] Passing output '' to Debug [20:54:36.967] Remove date[Debug] '', { filename = "{query}" ```
  8. Sure, and I do appreciate the time you and others here take to help us out. I have now raised an issue with the person who made the workflow, at https://github.com/mcskrzypczak/Alfred2-Workflows For my information, when you say there is no error in the log, I expected to see the content of the output between the single quotes? Is that expectation wrong? Thanks again.
  9. OK. I'll do that. I did in fact mention the name of the workflow, as you indeed quoted.
  10. I suspect I am having a similar problem after upgrading to a new iMac. Specifically, the workflow Copy name [1.6] has /usr/bin/python as the Language variable. $PATH does contain the paths to Python in /opt/Anaconda but workflow fails and the log shows: ```` [12:58:37.371] Copy name [1.6][Hotkey] Processing complete [12:58:37.379] Copy name [1.6][Hotkey] Passing output '' to Run Script [12:58:37.452] Copy name [1.6][Run Script] Processing complete [12:58:37.456] Copy name [1.6][Run Script] Passing output '' to Post Notification [12:58:37.457] Copy name [1.6][Run Script] Passing output '' to Copy to Clipboard ```` How might I ensure that the workflow uses the correct install of Python? Thanks.
  11. Thanks very much for your help. In the end, I went with a simplified script that requires me to save ongoing drafts in the same place with the same name. query=$1 cd '/Applications/MAMP/htdocs/grav-admin/user/pages/03.blog' mkdir ${query} cd ${query} touch item.md mv /Users/jeremycherfas/Desktop/item.md item.md It works fine for now. Obviously I still have a lot to learn about script workflows in Alfred, but this is encouraging.
  12. Apologies for the lack of clarity about my workflow. I was aware that Byword supported Applescript, hence this part of my original question. I am afraid my workflow when writing has to be a bit flexible. Sometimes the file has been saved before, sometimes it has not. Sometimes I think of a good title at the outset, sometimes I do not. The workflow I envisaged would be: Open Byword to start writing If necessary, save temporarily while I continue to work. At some point, think of a title, which becomes part of the YAML front-matter of whatever I am writing. If I am happy with the title, copy it to the clipboard. Start the workflow with the contents of the clipboard. Create a folder named as a slug of the title. Save the contents of the Byword document to item.md within that folder. As I see it, any method I wish to adopt, including moving the file, if it has been saved, needs to know the path to the folder that has just been created. I suppose one way to handle my requirements would be to always save the draft to the same name in the same place (e.g. <draft.md> on the desktop) and then use <mv path/to/{query}> as the final step. That might be simplest and, as I said, I am happy to adapt my workflow if that will help to automate parts of it.
  13. Ah, I did think of that. But the folder name is a slug based on the title of the piece, which often doesn't become clear to me until after I have written it. However, I could of course open the file as you suggest and then copy over whatever I have written. I'll see whether I can adapt to that. Thanks for the suggestion. I was being a bit blinkered.
  14. I write blog posts in Markdown using Byword. My CMS requires files to be saved as `item.md` in a folder named as a slug of the post title. I have a workflow that uses a very simple bash script to create the folder using the clipboard to pass the post title to the workflow and doing a few text transformations along the way. I would now like to extend that by getting Byword to save the contents of the document to `item.md` inside the new folder. I can create the file by extending the bash script, but is there a way I can directly tell Byword to save the document in `item.md`? I think I could do it in Applescript, but I am not sure how to pass the path to the folder bash creates to the applescript module. Any suggestions? Alternatively, if there is another Markdown editor that would work better with Alfred, I could try switching to that. Thank you.
  15. My "problem" is that I started using Applescript long before I had even heard of Alfred, and so for some of those simple in and out automations it is just the easiest thing for me. I'm not looking for help with Applescript (well, I am ...) but for help in using it with Alfred, mostly using Alfred as a trigger. From what I hear (e.g. On Automators FM) JXA is even stranger.
  16. Would you be willing to name names? Then I could study their workflows and learn.
  17. I'm sorry. My tone came over wrong. I sincerely meant thank you. I tried it as a Run Script action instead and all is well. My comment reflected the fact that whatever I searched for in Applescript seemed to focus more on why Applescript was a bad language rather than how to use it with Alfred. Your tip about not using NSAppleScript action, for example, cropped up occasionally without context.
  18. OK, thanks. I guess I don't know enough about Applescript to dislike it as much as many people here. Got it working a different way.
  19. I know this is a total noob question, but how do I pass the contents of the clipboard to an Applescript that I want to trigger in Alfred? I have a script that works fine if I copy some text to the clipboard and then run the script. Now that it works, I would like to be able to trigger the script from Alfred. I just cannot work out how to pass the contents of the clipboard to the script, the first line of which is `set theText to the clipboard`. Is there a way to select the text in the document and then trigger the script? I suppose that would mean changing the first line, but that's no problem. I'm happy to read a tutorial, but I'm just not sure where to look, as this seems to basic. Thanks Jeremy
  20. Thanks for this workflow. I have looked at `settings.json` but I do not understand what to change in order to get a file to open in BBEdit. Can you please explain? Thanks. Jeremy
×
×
  • Create New...