Extra Menu: Scriptables I

From Audacity Development Manual
Revision as of 21:34, 27 February 2018 by JamesCrook (talk | contribs) (What the 'Set' checkbox is for.)
Jump to: navigation, search
The images came out a bit naff, and I need to do them again. This is a rough draft.
The Extra > Scriptables menu provides commands typically used in scripting, for example via chains or Python.

Extra-ScriptablesMenu.png


These commands were originally written for scripting Audacity, e.g via a Python script that use mod-script-pipe. The commands though are also present in the menu, available from chains, and available from within Nyquist using (aud-do "command")
Tip Many of these commands have optional values.
  • Where the dialog shows a checkbox 'Set', leaving the box unticked leaves the corresponding value unchanged.
  • When using the same command in scripting, leaving the value out entirely has the same effect.


Select  

Select.png

Selects audio. Start and End are time.
First and Last are track numbers.
High and Low are for spectral selection.
FromEnd allows selection from the end, which is handy e.g. to fade in and fade out a track.
The Mode parameter allows arbitrary track selections, e.g adding or removing tracks from the current track selection.

Get Info  

Get Info.png

Gets information in a list in one of three formats.
Commands+ does not yet work, but is intended to include menu commands too.


Help  

Help.png

This is an extract from GetInfo Commands, with just one command.


Import  

Import2.png

Imports from a file. The automation command uses a text box to get the file name rather than a normal file-open dialog.


Export  

Export2.png

Exports to a file


Open Project  

Open Project2.png

Opens a project.


Save Project  

Save Project2.png

Saves a project.


Message  

Message.png

Used in testing. Sends the Text string back to you.


Screenshot (short format)  

Screenshot.png

A version of Help -> Screenshot with a more minimal GUI. One of the most useful options is All_Tracks.
The _Plus suffix includes the timeline.


Move Mouse  

Drag.png

Experimental command (called Drag in scripting) that moves the mouse.
An Id can be used to move the mouse into a button to get the hover effect.
Window names can be used instead of Ids.
If To is specified, the command does a drag, otherwise just a hover.


Compare Audio  

Compare Audio.png

Compares selected range on two tracks. Reports on the differences and similarities.


Get Preference  

Get Preference.png

Gets a single preference setting.


Set Preference  

Set Preference.png

Sets a single preference setting. Some settings such as changing the theme require a reload (use Reload=1), but reload takes time and slows down a script.


Set Clip  

Set Clip.png

Modify a clip by stating the track or channel and a time within it.
Colour and start position can be set.
Try to avoid overlapping clips, as Audacity will allow it, but does not like them.


Set Envelope  

Set Envelope.png

Modify an envelope by specifying a track or channel and a time within it.
You can't yet delete individual envelope points, but can delete envelopes (that contain the chosen time) using Delete=1.


Set Label  

Set Label.png

Modifies an existing label. You must give it the label number.


Set Project  

Set Project.png

Sets the project window to a particular location and size. Can also change the caption - but that is cosmetic and may be overwritten again later by Audacity.


Set Track 

Set Track.png

Sets properties for a track or channel (or both). Setting one channel of a stereo track can lead to interesting results. That's most used when setting relative sizing of the two channels.
SpectralPrefs=1 sets the track to use general preferences, SpectralPrefs=0 per track prefs. When using general preferences, SetPreference can be used to change a preference and so affect display of the track.
Name is used to set the name. It is not used in choosing the track.