More on my Digital Asset Manager i(n) Finder macros.
The others have been trivial, maybe this one will be too. I have attached 2 macros that are intended to do the same thing. But fail essentially in the same way but in two different actions.
In the attached macros, the offending action is highlighted as red.
What am I attempting to do: Using the selection in the finder as a source image, I want to use it to change the icon of the parent folder.
Seems pretty straight forward. However, where I am attempting to assign the image from a variable, the action it fails. If on the other hand, I assign it by hard coding the path to the variable it works. The path format, I am pretty sure, is good. As it is the same variable that is used to derive the path of the parent folder. Which, again it works if I hard code the path in the action.
In one macro, I am attempting to do it directly from the image file to the Parent folder. In the other, I am attempting to side step it by assigning the image to the clipboard and then to the folder.
Too, if I put in %FinderSelection% in this location, it also fails. I would think this should work too, as the file is still selected at this point.
Hi. I tested Set Parent Folder Image Direct with the debugger. I'm not a frequent user of Finder paths in Keyboard Maestro so was surprised to see that the path to the selected folder has a return character appended by (I think) KM. So when you get the Parent path it just strips the return character. Meaning you didn't get the Parent at all. Maybe I've hit a bug with Monterey, I don't know. But to get your code to work in my environment I would first have to assign the parent to Path (stripping the return character) and then assign the next parent to Parent. I haven't tested further... do you also see a return character at the end of Path when you run the debugger?
Thank you for the reply. I do in fact see the return character. however, when I display the variable to the window. (action that is turned off). I do not see it there. So, I assumed that was the actual output.
The "Parent" works as expected. It is the image file that is working wonky. (the one WITH the return character). I will see what it takes to manually strip the return character from the variable.
Edit::: This does not work. I had an image already set into the Clipboard from which it pulled from. Bummer! So, how do I get rid of the carriage return?
:::::::::::::::::::
Richard,
That Carriage return was the issue. I fixed it by the action: Append Variable "Path" with Text "\b"
Using the escape character "\b" to do the work.
I wasn't sure KM would allow escape characters, but what do you know!
I did try to put the escape character directly into the original set Variable action, but that did not work
Thanks for the the nudge in the right direction!
I really love this app!!!