Code: Select all
var tracks = Tracktion.getSelectedEditElements ('track');
var track = tracks[0];
if (track.getProperty ('name') == 'Guitar')
Tracktion.showMessage ('Guitar');
Code: Select all
var tracks = Tracktion.getSelectedEditElements ('track');
var track = tracks[0];
if (track.getProperty ('name') == 'Guitar')
Tracktion.showMessage ('Guitar');
Puzzled here. I couldn't getAGreen wrote:Hi dRowAudio (or any one else), I wonder if you can tell me why javascript such as the following doesn't work. To me it looks ok but the editor won't accept it. Does the getProperty method only work in certain circumstances?
Also, how would I go about getting a list of all plugins on a track and is it possible to select a track without selecting another object like a plugin or clip first.Code: Select all
var tracks = Tracktion.getSelectedEditElements ('track'); var track = tracks[0]; if (track.getProperty ('name') == 'Guitar') Tracktion.showMessage ('Guitar');
Yes jabe, there seem to be some funny things going on. Some statements will work in a for loop but not as a single line which is very odd. The getProperty statement seems to be an example of that. We really need a list of methods and their usage because otherwise we're working blind. The following works by the way:jabe wrote:
Puzzled here. I couldn't get
if (track.getProperty ('name') == 'Guitar')
accepted. It did accept
if (track.getName == 'Guitar')
but the value of track.getName was always "undefined".
Code: Select all
var tracks = Tracktion.getSelectedEditElements ('track');
for (var i = 0; i < tracks.length; i++){
var track = tracks[i];
if (track.getProperty ('name') == 'Guitar')
Tracktion.showMessage ('Guitar');
}
It should show up next to the mouse if the track is named "Guitar" and it's selected.jabe wrote:The Tracktion.showMessage() bit isn't showing a message here, unless I'm looking in the wrong place.
I put that line on its own in a macro and caught the bubble with it in. Thanks.AGreen wrote:It should show up next to the mouse if the track is named "Guitar" and it's selected.jabe wrote:The Tracktion.showMessage() bit isn't showing a message here, unless I'm looking in the wrong place.
© KVR Audio, Inc. 2000-2024
Submit: News, Plugins, Hosts & Apps | Advertise @ KVR | Developer Account | About KVR / Contact Us | Privacy Statement