I exported my Voice Control Custom Commands but how do I open the file to see a list?

I exported my Voice Control Custom Commands but how do I open the file to see a list? I just get code, and simply want a list of my Custom Commands. In what app do I open the file? Textedit gave me only code.



thanks

Posted on Apr 22, 2022 10:07 PM

Reply
Question marked as Top-ranking reply

Posted on Apr 23, 2022 3:05 PM

You need to extract the elements of that XML plist to get at the actual custom voice commands. If you copy and paste the following AppleScript code into Apple's Script Editor, click the compile (hammer) buitton, and run, it will present you with a dialog list of your custom commands (more or less).


use framework "Foundation"
use AppleScript version "2.4" -- Yosemite or later
use scripting additions

property NSArray : a reference to current application's NSArray

set plist to "$HOME/Library/Preferences/com.apple.speech.recognition.AppleSpeechRecognition.CustomCommands.plist"

set custom_commands to paragraphs of (do shell script "plutil -p " & plist & " | awk -F '\"' '/0 =>/ {$1=$1;print l;l=substr($2,1,length($2))}'")

if (count of custom_commands) = 0 then return

set custom_array to (NSArray's arrayWithArray:custom_commands)'s mutableCopy()
custom_array's removeObject:""
display dialog (custom_array's componentsJoinedByString:return) as text with title "Custom Voice Commands"
return


2 replies
Question marked as Top-ranking reply

Apr 23, 2022 3:05 PM in response to raspberryaddiction

You need to extract the elements of that XML plist to get at the actual custom voice commands. If you copy and paste the following AppleScript code into Apple's Script Editor, click the compile (hammer) buitton, and run, it will present you with a dialog list of your custom commands (more or less).


use framework "Foundation"
use AppleScript version "2.4" -- Yosemite or later
use scripting additions

property NSArray : a reference to current application's NSArray

set plist to "$HOME/Library/Preferences/com.apple.speech.recognition.AppleSpeechRecognition.CustomCommands.plist"

set custom_commands to paragraphs of (do shell script "plutil -p " & plist & " | awk -F '\"' '/0 =>/ {$1=$1;print l;l=substr($2,1,length($2))}'")

if (count of custom_commands) = 0 then return

set custom_array to (NSArray's arrayWithArray:custom_commands)'s mutableCopy()
custom_array's removeObject:""
display dialog (custom_array's componentsJoinedByString:return) as text with title "Custom Voice Commands"
return


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

I exported my Voice Control Custom Commands but how do I open the file to see a list?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.