Having a problem with this one on "Insert Text". I can display the content of the variable ProjectName as the actual value however using the variable defined as any of the following in the "Insert Text by Typing"
field will type the literal text and not the value of the variable:
What am I doing wrong? If I can display the actual value of the variable in a display window using something as Audio File name is %Variable%AudioFile% then why won't the Insert Test by Typing acknowledge the variable value as opposed to literal text
The action where you're trying to set %AudioFileName% is unnecessary and the wrong way round. What you're actually doing is setting %Variable%ProjectName% to %AudioFileName, which has no value.
Delete it and try %Variable%ProjectName%.
More broadly, what exactly is this macro trying to do?
Extract the Window Title name and extract the word "Bounce" and the quotation marks so I can use the actual name of the Project to use as the name of the file to save.
Preferably I was initially looking for some type of substring function which would have been a lot more simpler but the only other way I found through the posts was using Regex which personally to me is an overkill way of doing something this simple.
Ok, so I did as suggested and the text typed in the save dialog box is still the literal variable name. Also noted that the last % sign is truncated for some reason
So I decided to look at the menu options for the action and it was set to "Process Nothing" Changed it to "Process Text Tokens Only" and it works now. But if there is a more elegant way to substring and trim aside from using Regex I'd love to hear the suggestion.
You should always post sample "before" strings and the output you are trying to achieve when asking this sort of question. My guess is that you want something like
Bounce "Some text here"
...to become
Some text here
i.e. "extract the substring between the first and last dumb quotes", for which you could use the regular expression:
There are other ways of doing it -- for example, if you never have quotes inside the quotes delineating your substring you could use KM's pseudoarray construct with %Variable%Local_testString[2]"% (see variable arrays and custom delimiters, here) -- but a regex is probably the most precise method.
Hello Nige_S, thanks for your response and I'll definitely adhere to your suggestion for any similar future posts.
The regex is greatly appreciated and I'll likely replace my existing method in favor of what you've provided. I am very familar with regex as I have used it quite a bit in my development work but I suppose I'm so used to substring functions for performing these types of trivial tasks that I opted out of using regex for it. Had you not provided it, honestly I wouldn't have invested any time to use it.
This gets the name from the - Tracks window and gives you a few options for where to bounce to. Change the path in the green action to your Mixdown Folder.
There is a substring action but it works with numbers (or, more correctly, variables which evaluate to numbers). You could "split" on a custom array delimiter, get the CHARACTERS() of the first item, add one to account for the delimiter, use that number as the start of your substring, etc, etc -- but you may as well go straight to a regex!
It almost sounds like KM is a level or three of abstraction above what you are used to. Embrace that, use the built-in conveniences, and let KM take care of the low-level stuff for you