Jump to content

Create and name folder workflow stopped working


Recommended Posts

I believe the workflow is by Jono Hunt. It creates a folder in the current Finder window and renames it. I set it up years ago to create about 5 folders and rename them. Suddenly it stopped working today and is throwing up an error that I don't understand, which you can see in the debugger in this screenshot attached.

 

I wondered if any of you have ideas I can try in order to get this running again.

Screenshot 2023-01-17 at 1.43.43 PM.png

Link to comment

I do have the workflow, but I don't know how to attach it to an Alfred forum post since it's not an image.

 

I've not attempted to use an Automation Task before. Will read through what you linked to. Update: read through the Automation article and went through some set up steps. It will allow me to create a new folder, but I don't see a way to rename folders with it. Are you aware of a way to rename folders with the automation method, @vitor

Edited by AuthorsAssembler
More info
Link to comment

@AuthorsAssembler I have a post here which may help.

 

(I'm currently developing a workflow which will:

  • create a new folder in the current folder;
  • prompt for the name of the new folder; and
  • optionally transfer to the new folder the selected file(s) in the existing folder.

However, that's not yet finished and, note, will not create a new folder tree but merely one new folder. When it is finished I'll release it on GitHub and share it in the appropriate forum.)

 

Edit: see here for the new workflow.

 

Stephen

Edited by Stephen_C
Added link to new workflow
Link to comment
11 hours ago, Stephen_C said:

@Stephen_CThat's a cool feature to transfer selected files into the newly created folder. Smart! I bet I could use that for some other important tasks. I'll check it out for sure. Thank you! And come to think of it, I could use this for the first part of the workflow, when I move files from G Drive to Ext HD.

@vitorFor this workflow, I basically have a set of images in my Google Drive. With the workflow I was using, I'd create a new folder on my external hard drive in my stock art archives dump all the new collection images in there and then hit Shift + Option + Command + T to dump 5 folders in there and rename them to things like PNGs, Jpegs, etc.

Since this is such a repetitive daily task for me, I'd love to continue to with that current workflow if I can just figure out what the error message means: "ERROR: Render Only Folders[Run Script] 157:162: execution error: Can’t make «class fvtg» of window 1 of application "Finder" into type alias. (-1700)"

I wondered if it has something to do with this being on a brand new Mac. Maybe I need to configure it to look in a different place for something. Not sure.

 

Edited by AuthorsAssembler
Link to comment

I googled "class fvtg" to see if I could learn some more about this error message and found this conversation on github.  https://github.com/rkanter/Open-iTerm-or-Terminal-Here.../issues/2. And that convo links to this explanation: https://apple.stackexchange.com/questions/37769/in-terminal-can-i-find-out-the-current-finder-folder/37772#37772.

 

I'm struggling to understand all the terminology, as I don't have a coding background, but it kinda makes me wonder if it doesn't like my pathways or pathnames. I'd initially think it's grumpy about the fact that I'm trying to use this workflow on my external drive, but I also tried to use it on my internal hard drive and on my Mac desktop and it didn't work there either.

Link to comment

Thanks, @Stephen_C, I'll take a look at those. One thing I'm finding confusing is what is meant by "as alias". When I think of an alias, I think of a shortcut "alias" folder on a Mac. Is that what it means in this context of Apple Scripts?

 

Is there a spot on the web where I can look up such terms to both learn them and also how to use them in the context of script writing?

 

For example, I'm wondering if I can change "currentWindow" in the original workflow to "activeWindow" or similar to ensure it's trying to apply the workflow in the active frontmost window.

Edited by AuthorsAssembler
Link to comment
18 hours ago, AuthorsAssembler said:

I do have the workflow, but I don't know how to attach it to an Alfred forum post since it's not an image.

 

transfer.sh is good temporary storage. Then you paste the link here.

 

@AuthorsAssembler I’d recommend taking a look at @Stephen_C’s workflows in general, as they do a lot without code and are good examples for others wanting to learn. For an interactive tutorial on making a workflow, see the Getting Started Guide. But I also understand you already have one workflow you like and right just want that to work. The error you’re getting comes from the Finder so there may be something amiss with the folder you have as the frontmost (e.g. you may have none open, or be in the Airdrop or Recents view).

 

34 minutes ago, AuthorsAssembler said:

it kinda makes me wonder if it doesn't like my pathways or pathnames.

 

May be. What’s the full path to the folder in question?

 

21 minutes ago, AuthorsAssembler said:

One thing I'm finding confusing is what is meant by "as alias". When I think of an alias, I think of a shortcut "alias" folder on a Mac.

 

Yes, that’s unfortunate naming on Apple’s part. In that context, an alias is simply a different representation of a path. For the “POSIX” path /Users/yourname/Desktop, the equivalent “as alias” would be something like Macintosh HD:Users:yourname:Desktop:. Don’t get caught up in that part of the terminology, as it’ll only be relevant in AppleScript and everyone pretty much goes for the POSIX variant except when not possible.

 

27 minutes ago, AuthorsAssembler said:

Is there a spot on the web where I can look up such terms to both learn them and also how to use them in the context of script writing?

 

Apple’s documentation is, in general, sparse. But for AppleScript and its companion JavaScript for Automation (a.k.a. JXA) they have a short and useful guide. You can experiment in the Script Editor app which ships with macOS.

 

29 minutes ago, AuthorsAssembler said:

I'm wondering if I can change "currentWindow" in the original workflow to "activeWindow" or similar to ensure it's trying to apply the workflow in the active frontmost window.

 

You can change it but it won’t make a difference. In that context (as per your screenshot), currentWindow is simply a variable name, i.e. the name the author chose as a shorthand to represent something else later in the code. It could be called anything, even pineapple or emilyDickinsonsDesk, but currentWindow is definitely clearer!

Link to comment

@vitor Thank you for your reply. I hadn't thought about uploading via a third party service. Hopefully this Dropover app link will work so you can see the workflow as it currently stands: https://dropover.cloud/cd3cea

 

I modified it from Jono Hunt's original to add more folders with names I needed. But otherwise, I haven't adjusted the script coding in any way beyond changing the names. I did try to go back and find where I originally downloaded that workflow, but none of the links for Jono are still active and I can't recall the name of it, so I wasn't sure how to search for it in the forums or on the webs.

 

When I go to use the hot key for this workflow I open up a Finder window and as far as I can tell the current folder is the active/current window. So for example, I've not switched to Airdrop, etc.

 

For testing purposes, I'm now just trying to create the folders at this path: /Users/nephelle/Desktop/Test.

 

Just a guess, but could the script simply need a different, more clarifying name for Finder, so it's finding it properly? Trying to learn from the articles y'all posted and getting really confused, but maybe something like Finder Window vs. just the below:

tell application "Finder"

 

Thank you for mentioning the great resources!

Edited by AuthorsAssembler
Link to comment

I cannot reproduce the error, it works for me.


That said, if I understand correctly it basically creates a bunch of statically named folders in the the current Finder folder, correct? We can remake that without any code, just Automation Task and Arg and Vars Utility, making it easier to edit/add new folders and they’re created faster!


Give this one a try. If it still fails, let us know the new error and we can proceed from there.

Link to comment

I'm glad to hear that workflow was working for you. Means I'm not going crazy--my MacBook is. ;)

 

Wow, @vitor that workflow you created works beautifully. Thank you for creating it. It was good to study the setup, so I have a better understanding of how this type of workflow works. I was even able to add in another (I guess you would call it) argument to add another folder for PNGs. Worked great!

 

I like this Automation style of workflow a lot better. I just need to read up on this more and practice some simple ones so I start to get how it works. Thanks for getting me started.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...