Jump to content

noisyneil

Member
  • Posts

    34
  • Joined

  • Last visited

Posts posted by noisyneil

  1. What I'd love to do is type in a search term and select a track to play from the top online results, just like in the desktop app. Is this possible? I can navigate to a track by narrowing by artist first, but it's a much more slow and fiddly to do. Here, the top gif is with your workflow and the bottom is with the desktop app. 

     

    https://imgur.com/a/KCuO74r

     

    Am I missing a simpler way to quickly find a track and play it?


     

  2. 22 minutes ago, deanishe said:

    Delete the originals after the copy?

    That isn't necessary in the other AppleScript code, so I'm wondering what's different about the one we're now using? Given that it's two steps (copy then delete), it might mess up Finder's undo-ability, no?

    Regardless, I don't know how to do that, as usual. 🥴

     

  3. I just tried it and it's allllmost perfect. The only issue is that it copies, rather than moves the file, which I suspect is because the destination folder is on a different volume. I know it's possible to move between volumes, as the other 'move file' script I use with KM does it nicely. One little tweak and it's a home run! 

    21 hours ago, noisyneil said:

    Pasted_Image_26_11_2021__15_01.png.be2f178013592b4468035ab0c799c888.png

     

  4. 9 minutes ago, deanishe said:

    I'm not sure I've understood you correctly here. It sounds like you need to pass the selection to an already-running script. How do you plan to do that?

     

    I just did some research and found that AppleScript can't respond to user input, so there's no point trying to explain my (probably flawed) logic.

     

    I am surprised that Alfred doesn't have a 'pause until' module, which could be used to trigger subsequent actions, but I think that's just me with my KM head on. 

     

    11 minutes ago, deanishe said:

    Upload your workflow

     

    There's not much to it at the moment as I can't get the two actions (browse and script) to work together as one. It's just a browse command and two options for trying to trigger the script, neither of which work. 

    image.png.125340876b113cded424a8541871009b.png

  5. 9 hours ago, deanishe said:

    you've certainly got the right attitude and approach. So I'm trying to point you in the right direction rather than spell things out for you.

    I appreciate it. Probably the best way for me to learn, rather than be spoon-fed. As long as it's not tiresome for you!
     

    9 hours ago, deanishe said:

    In the second “paragraph”, you’re still trying to use FileDest, which you’ve removed from the script.

    🤦🏻‍♂️  D'oh!
     

    9 hours ago, deanishe said:

    here's a working version of the script

    Thanks for taking the time to do that! 

     

    So here's where I'm at, currently:

    I can now hit a hotkey and navigate straight to the parent directory within Alfred's browser. From there I can use the arrow keys to drill down into the desired destination folder. So far so good!

     

    I made the script you sent me into into a file action, but when I select and trigger it, nothing happens. Changing the errant 'FileDest' to 'destination' in the previous AppleScript version doesn't work either. 

     

    I tried assigning the scripts directly to a hotkey, but again nothing happens when I trigger them (while the destination folder is selected in Alfred's browser). 

     

    I suppose the first thing is to get the script working. Once that's done, it needs to be triggered. The ideal scenario would be that you hit enter when the folder is selected. As I understand it, that's not possible with Alfred, so I wonder if this might be a way of doing it?:

     

    Could we add a line to the script that tells it to wait until the enter key is depressed before running? That way it's already been triggered by the same hotkey that navigates to the parent directory but doesn't do anything until I've confirmed the selection. Just trying to think laterally here. Thanks again for your help so far! 

     

     

     

     

     

     

  6. Sorry if this is at all frustrating but you're dealing with a workflow noob here. Your answers, while I'm sure they're correct, are very brief and I'm struggling to make sense of them. 

    I tried my hardest to think it through and came up with this but it doesn't work:

    image.png.753bccea8278da1c66e61d493088809c.png



    So I should set up a hotkey trigger and trigger the script (once I've figured it out) directly? I thought you said it would only work as a file action and I can't see a way to trigger a file action from a hotkey. 

     

  7. 28 minutes ago, deanishe said:

    Replace FileDest with the path you get from Alfred.

     

    I don't know what you mean. Are you saying I can use Alfred to get the destination folder path and then use Keyboard Maestro to run the "Move File" script using that path from the clipboard? If so, how do I get the path?

     

    28 minutes ago, deanishe said:

    Any Hotkey with "Selection in macOS" also works in Alfred.

    Again, I don't know what you mean. I'm asking if, once you have a destination folder selected in Alfred's browser, it's possible to hit a hotkey and run the script as a file action. 

  8. 23 minutes ago, deanishe said:

    Undo only works if you tell Finder to move the files itself, not if you tell it to run a shell script. How is Finder supposed to know how to undo that?

    I have another AppleScript that moves files, which I trigger via Keyboard Maestro and undo works fine. This must be, as you say, because it isn't using a shell script:

     

    Pasted_Image_26_11_2021__15_01.png.be2f178013592b4468035ab0c799c888.png


    Unfortunately my scripting knowledge is practically nil, so I'm not sure how to replace the shell script part with pure AppleScript language, but it seems that could solve the problem. 

     

    32 minutes ago, deanishe said:

    You can't directly plug Alfred's navigation mode into your own code. You have to go via the File Actions menu.


    Seems that I've misunderstood a core concept, haven't I! Ok, how about a hotkey to perform a file action on Alfred's browser selection. That would be preferable than having to manually select the file action from the menu, if it's possible. 

  9. Ok, so I think I've figured out how to make the AppleScript into a file action! 

     

    I can now manually navigate to the destination folder, hit ctrl, select my file action and hit enter. It works! For some reason, undoing the move isn't possible though. 😢

     

    image.png.37b49aa86db9c94627c218cda42f4778.png

    image.png.00d7b6bc9d582454dc801c0a524b4641.png

     

    At the moment, this takes longer than manually dragging and dropping. For it to be the full-blooded time saver that I'm hoping for I'd like to reduce the number of steps, if possible. 

     

    I'd like to hit a hotkey which takes me directly to the parent directory in Alfred's browser (so it displays the first level of subfolders below the parent). Then I'd drill down to the desired destination for the file(s), hit enter, and they move. 

    So far, I have a hotkey that gets Alfred to navigate to the parent folder. Great!

    image.png.ea76e2d70ac66f965835447f5f282a57.png

     

    How do I get the script to run (as a file action or otherwise) upon hitting Enter?

     

     

  10. 1 hour ago, deanishe said:

     

    Can you be more precise? Like, is it always the same parent directory, or do you mean the parent directory of the files you're moving?

     

    Describe the task as if you were explaining how to move the files to someone who's got to do it for you while you're on holiday.

    I'll do my best:

     

    I keep a bunch of audio/video projects on my internal SSD while they're in progress. Once they're finished (or put on hold), I want to archive them to an external drive, categorised according to client, project type, genre, level of completion, etc. 

     

    For this purpose, I have an existing folder on my external drive called "Projects"; within is the respective hierarchy of sub-folders. 

     

    I want to select a group of files and/or folders on my internal drive, invoke a workflow and immediately see this hierarchy of subfolders within Alfred's browser. Using the arrow keys, I would then drill down to the correct destination for this particular group of files and hit Enter. The selected files would then be moved, ideally with the possibility of undoing the move that AppleScript has the potential to allow, should I accidentally send something to the wrong destination folder. 

     

    In short, for this purpose the parent folder would be static.

     

    1 hour ago, deanishe said:

     

    That's because doing that exits the workflow. It uses a regular File Filter: there is no drilling down, just a flat list of results.

     

    If you want to be able to use Alfred's full navigation capabilities, you need to re-implement the move as a File Action. Then you can call it on any folder shown anywhere within Alfred at any time. (Or a folder in any other application if using a Hotkey.)

     

    I'm not sure how to do this. Any advice would be much appreciated. I've had Alfred for years but never made any workflows beyond the most simple you can imagine. 

  11. Hi! I've started my own thread about it as I figured this was so old I'd be unlikely to get any responses. What a pleasant surprise that you said hello! 

     

    I think this should be relatively simple for someone who knows what they're doing and I can imagine it could be very useful for anyone who has to regularly archive and sort large numbers of files to one parent directory. I'm slowly becoming a Keyboard Maestro ninja, but I'm all thumbs with Alfred and I have zero AppleScript fluency, so any help would be awesome! If you think you might be able to help, perhaps it's best to continue chatting on the other thread? I don't want to irritate people with notifications on this one. 😊

  12. Hi. 👋🏼

     

    I'd like to build a simple workflow that will move the Finder selection to a subfolder of a single parent directory, using AppleScript. Example:

     

    1. I select my file(s) and invoke the workflow.

    2. Alfred displays the parent directory in its interface.

    3. I drill down to find the desired subfolder.

    4. I hit enter and it moves the file there. 

     

    This workflow almost does it, but doesn't support subfolders. If you type the name of the folder you want to send the file to and hit enter, it moves it there, but if you try to drill down with the right arrow key, hitting enter opens that folder in a new Finder window instead. Could it perhaps be modified to do what I'd like it to? I like that it uses AppleScript, because that means it has the potential to allow Finder's undo capability, although that doesn't seem to work with the workflow I posted above for some reason.

     

    Many thanks for any help,

     

    Neil

×
×
  • Create New...