# Is there an Action %ask% capability?

**URL:** https://community.mp3tag.de/t/is-there-an-action-ask-capability/16593
**Category:** Support
**Created:** [February 12, 2015, 11:31pm UTC](https://community.mp3tag.de/t/is-there-an-action-ask-capability/16593 "2015-02-12T23:31:26Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![phossler](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@phossler](https://community.mp3tag.de/u/phossler)
#### Post date: [February 12, 2015, 11:31pm UTC](https://community.mp3tag.de/t/is-there-an-action-ask-capability/16593/1 "2015-02-12T23:31:26Z")

</div>

I have an action to trim a number of characters from the front of a Title

(My) Problem is the number of characters varies and I have to edit the action statement

For ex -- this will delete 4 char:

```
$right(%title%,$sub($len(%title%),4))

```

and if I need to delete 2 then I have to edit it to

```
$right(%title%,$sub($len(%title%),2))

```

Sometime I forget and run it with the old/wrong number

If the action 'language' would allow (if it already does, I did't find it) a 'run time' input, possibly with a prompt, it'd be helpful

$right(%title%,$sub($len(%title%),%ask:NumberOfChars%))

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [February 13, 2015, 6:33am UTC](https://community.mp3tag.de/t/is-there-an-action-ask-capability/16593/2 "2015-02-13T06:33:48Z")

</div>

> [@Paul\_Hossler](#):
>
> I have an action to trim a number of characters from the front of a Title
> 
> (My) Problem is the number of characters varies and I have to edit the action statement  
> ...

For this there is the $trim() function.  
Use an action of the type "Format value" for e.g. TITLE and use as  
format string: $trim(%title%)  
This should do the trick.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [February 13, 2015, 7:54am UTC](https://community.mp3tag.de/t/is-there-an-action-ask-capability/16593/3 "2015-02-13T07:54:06Z")

</div>

> [@](#):
>
> I have an action to trim a number of characters from the front of a Title ... If the action 'language' would allow (if it already does, I did't find it) a 'run time' input, possibly with a prompt, it'd be helpful ...

Beside the interactive converters, there is no user interaction dialog available for actions.  
But you can prepare a number of actions, to diminish the problem.  
You can create a bunch of prepared actions ...  
... with formatstrings like ...  
$cutLeft(%TITLE%,1)  
$cutLeft(%TITLE%,2)  
$cutLeft(%TITLE%,6)  
$cutLeft(%TITLE%,17)  
$cutLeft(%TITLE%,49)  
... and name those actions like ...  
Title &cut left#&1  
Title &cut left#&2  
Title &cut left#&6  
Title &cut left#1&7  
Title &cut left#4&9

Also check out the function $trimLeft(), which probably could replace all the special designed $cutLeft functions.

DD.20150213.0957.CET

---

<div class="post-metadata">

### Author: ![phossler](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@phossler](https://community.mp3tag.de/u/phossler)
#### Post date: [February 13, 2015, 11:18pm UTC](https://community.mp3tag.de/t/is-there-an-action-ask-capability/16593/4 "2015-02-13T23:18:41Z")

</div>

Thanks, but somehow it just 'doesn't feel right' to create a bunch of actions just to Trim1, Trim2, Trim3, ....

If I get Titles like '01 Sing Along With Me' I want to delete the left 3 chars

Sometimes I have an audio book with titles like 'Split01 Introduction', 'Split02 The Beginning', ... or 'Split01-Introduction', 'Split02-The Beginning',

In the second case I'd want to remove the left 8 char

I recall the record Title cleanup required removing 17 characters (ugly)

If there is not way to 'ask' then I suppose I could create Actions to Trim1, Trim5, Trim10, etc. and run the different ones the right number of times

Ex. For the 17, run Trim10, Trim5, and Trim1 two times

Just thinking the might be a better way but I will check out %cutLeft and $trimLeft() -- thanks for the tip

---

<div class="post-metadata">

### Author: ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)
#### Post date: [February 14, 2015, 7:55am UTC](https://community.mp3tag.de/t/is-there-an-action-ask-capability/16593/5 "2015-02-14T07:55:19Z")

</div>

> [@Paul\_Hossler](#):
>
> If I get Titles like '01 Sing Along With Me' I want to delete the left 3 chars
> 
> Sometimes I have an audio book with titles like 'Split01 Introduction', 'Split02 The Beginning', ... or 'Split01-Introduction', 'Split02-The Beginning',
> 
> In the second case I'd want to remove the left 8 char

If you want 1 action for all you have to find out in what way the examples are identical and use a different approach with the action type "Guess Values". This action type needs a unique delimiter, which is a white space or a hyphen in your example. Only you can know whether you have unique delimters between the characters to cut off and the rest of the title.

Type: Guess Values  
Source Format: %title%  
Guessing Pattern: %dummy% %title%

or

Type: Guess Values  
Source Format: %title%  
Guessing Pattern: %dummy%-%title%

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [February 14, 2015, 8:03am UTC](https://community.mp3tag.de/t/is-there-an-action-ask-capability/16593/6 "2015-02-14T08:03:12Z")

</div>

> [@Paul\_Hossler](#):
>
> ... If I get Titles like '01 Sing Along With Me' I want to delete the left 3 chars ...

This is a good example to apply the function $trimLeft.

**From : '01 Sing Along With Me' To : 'Sing Along With Me' Action: Format value Field : TITLE Formatstring: $trimLeft(%TITLE%,'0123456789. ') ... or ... Formatstring: $regexp(%TITLE%,'^[0-9.\s]+',)**

> [@Paul\_Hossler](#):
>
> ... Sometimes I have an audio book with titles like 'Split01 Introduction', 'Split02 The Beginning', ... or 'Split01-Introduction', 'Split02-The Beginning', In the second case I'd want to remove the left 8 char

See also ... Action "Guess values"  
... for example ...

TITLE='Split01 Introduction'  
Sourceformat: %TITLE%  
Formatstring: %PART% %SUBTITLE%  
==\> PART='Split01'  
==\> SUBTITLE='Introduction'

... or ...  
TITLE='Split01-Introduction'  
Sourceformat: %TITLE%  
Formatstring: %PART%-%SUBTITLE%  
==\> PART='Split01'  
==\> SUBTITLE='Introduction'

... or ...  
TITLE='Split01-Introduction'  
Sourceformat: %TITLE%  
Formatstring: Split%TRACK%-%SUBTITLE%  
==\> TRACK='01'  
==\> SUBTITLE='Introduction'

... or ...  
TITLE='Split01-Introduction'  
Sourceformat: %TITLE%  
Formatstring: %DUMMY%-%SUBTITLE%  
==\> SUBTITLE='Introduction'

DD.20150214.1008.CET

---

<div class="post-metadata">

### Author: ![phossler](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@phossler](https://community.mp3tag.de/u/phossler)
#### Post date: [February 19, 2015, 2:32am UTC](https://community.mp3tag.de/t/is-there-an-action-ask-capability/16593/7 "2015-02-19T02:32:06Z")

</div>

Ahh, I did not realize that $trimLeft could take multiple characters

I read the help and to me it read like only a single character would be trimmed:

> [@](#):
>
> $trimLeft(x) trims all leading whitespace from the string x.  
> The optional second parameter specifies the character to trim

That really helps

I'll have to experiment with the Guess Values

Thanks to both of you for the tips

---

<div class="post-metadata">

### Author: ![phossler](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@phossler](https://community.mp3tag.de/u/phossler)
#### Post date: [February 20, 2015, 1:07pm UTC](https://community.mp3tag.de/t/is-there-an-action-ask-capability/16593/8 "2015-02-20T13:07:32Z")

</div>

Added a 2 step action using Guess values to strip prefixes from Titles with the most common combinations of dash and space

So starting with this ...

Split01 - Sing Along With Me  
Split01-Sing Along With Me

Using these in sa single action

%dummy% - %title%  
%dummy%-%title%

I end up with

Sing Along With Me

Works great

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:25pm UTC](https://community.mp3tag.de/t/is-there-an-action-ask-capability/16593/9 "2026-02-09T12:25:31Z")

</div>


