Trying to make a Speak text macro that pauses other speaks when activated

Can't seem to make it work.
It can read allowed but dosnt seem to run when I try to cancel the older one when running.

Here it is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Actions</key>
	<array>
		<dict>
			<key>ActionUID</key>
			<integer>429</integer>
			<key>Conditions</key>
			<dict>
				<key>ConditionList</key>
				<array>
					<dict>
						<key>ConditionType</key>
						<string>Macro</string>
						<key>MacroConditionType</key>
						<string>IsActive</string>
						<key>MacroUID</key>
						<string>BB3DD131-15E1-4C9B-A610-E4517E2D5401</string>
					</dict>
				</array>
				<key>ConditionListMatch</key>
				<string>Any</string>
			</dict>
			<key>ElseActions</key>
			<array>
				<dict>
					<key>Action</key>
					<string>Copy</string>
					<key>ActionUID</key>
					<integer>427</integer>
					<key>MacroActionType</key>
					<string>ClipboardSwitcherMacroAction</string>
					<key>Name</key>
					<string>918458FB-02CB-47D3-9F70-F5E663502CC7</string>
					<key>RedundandDisplayName</key>
					<string>tekst der skal læses op dk</string>
					<key>TimeOutAbortsMacro</key>
					<true/>
				</dict>
				<dict>
					<key>ActionUID</key>
					<integer>428</integer>
					<key>MacroActionType</key>
					<string>SpeakText</string>
					<key>Rate</key>
					<string>Quick</string>
					<key>Text</key>
					<string>%NamedClipboard%tekst der skal læses op dk%</string>
					<key>TimeOutAbortsMacro</key>
					<true/>
					<key>Voice</key>
					<string>com.apple.voice.enhanced.da-DK.Magnus</string>
					<key>Volume</key>
					<integer>90</integer>
				</dict>
			</array>
			<key>MacroActionType</key>
			<string>IfThenElse</string>
			<key>ThenActions</key>
			<array>
				<dict>
					<key>Action</key>
					<string>CancelSpecificMacro</string>
					<key>ActionUID</key>
					<integer>431</integer>
					<key>Instance</key>
					<string>THIS</string>
					<key>MacroActionType</key>
					<string>Cancel</string>
				</dict>
			</array>
			<key>TimeOutAbortsMacro</key>
			<true/>
		</dict>
	</array>
	<key>CreationDate</key>
	<real>688337769.59037006</real>
	<key>ModificationDate</key>
	<real>688338628.94469297</real>
	<key>Name</key>
	<string>Læs op på dansk copy</string>
	<key>Triggers</key>
	<array>
		<dict>
			<key>FireType</key>
			<string>Pressed</string>
			<key>KeyCode</key>
			<integer>105</integer>
			<key>MacroTriggerType</key>
			<string>HotKey</string>
			<key>Modifiers</key>
			<integer>0</integer>
		</dict>
		<dict>
			<key>FireType</key>
			<string>Pressed</string>
			<key>KeyCode</key>
			<integer>26</integer>
			<key>MacroTriggerType</key>
			<string>HotKey</string>
			<key>Modifiers</key>
			<integer>256</integer>
		</dict>
	</array>
	<key>UID</key>
	<string>BB3DD131-15E1-4C9B-A610-E4517E2D5401</string>
</dict>
</plist>

To share a macro to the forum, using the Share button at the top of the editor. That can include the macro and an image of the macro which makes it easier for folks to respond.

You are misunderstanding the meaning of "active". See Macro Activation.

What do you want to do if you run the macro a second time?

  1. Cancel the old instance.
  2. Not run the new instance.
  3. Wait until the old instance finishes and then run the new instance.

Each can be done, but in different ways.

Yeah I thought I did :slight_smile:

  1. and run it from the start.
    Så cancel the one that is running and start again

Thanks :slight_smile:

The other two can be done easily by just sticking a Semaphore Lock action at the start (either with a long timeout or a very short timeout).

To cancel the existing macro, start your macro with:

image

Basically, Cancel a Specific Macro action, which cancels the instance stored in the variable, and then save the instance of this macro into the variable.

Nice thanks!

Found out I can do it with "cancel all other macros "
So it works when I on error select the wrong macro, because I have one for each language to read allowed in.