In Automator, can I combine 2 or more variables into a new variable

applescriptautomatorfinderterminal

First off, let´s set the scene. I am trying to make a small applet (.app) to include in a DMG-file for distribution. The .app file will only activate when a user drags a folder with my product-files onto it. Then the folder is supposed to be copied into the current user´s /Music/MY CUSTOM PATH/. Any user on any system, that happens to be logged in.

This is similar to having a relative symlink/alias to the /Applications folder, like when you install google chrome or any app that comes in a dmg.

So, by using the Automator action "copy finder items" I dragged the pre-defined variable "variables > Locations > Music" to the action and that works well on any system, by copying any file you drag onto my .app into the users ~/Music folder.

Great. But my app goes into the folder ~/Music/Audio Music Apps/Patches/my-folder. Now what?

I have tried to find anything related to "combine folder paths" or "combine variables" or "append…" but with no luck. I´m to Automator so don´t know all the tricks. Please help me make it possible to create an app that can copy into ANY sub-folder of ANY user´s home folder, on any system.

Best Answer

Finally, there is no "combine variables" action per say in automator, but you can add a custom text variable, and drag another variable from the library variables into any part of the text in the value field. In my case, needing to combine paths to folders, this is the same thing.

  1. create a "text" variable from Variables > Text & Data > Text.
  2. Drag the desired variable into the "Value" field anywhere you need it.

Done. You can now add the text-variable you just made to the "copy Finder items" action as the destination. This enables you to use it on ANY system, ANY user. Very handy for an installation file, or any dock-app with custom paths (but still relative paths to whatever user is logged in).

enter image description here