I am using the following script for choosing standard text sentences whilst writing reports. The full version has 21 items in the subjectLst and multiple sentences in each of the other lists. It’s working very well for me on my Mac but I know that I am going to be asked if I can provide something similar for the guys using Windows machines.
I realise that I will have to rewrite it but I don’t know what to use? I have borrowed an old Windows 10 machine and tried dabbling in PowerShell but I really don’t know if that is the best option?
I’m not looking for anyone to write it for me but your thoughts would be appreciated.
Regards,
Niscors
setClipboard()
the clipboard -- just for testing
on setClipboard()
set subjectLst to {"Doors", "Windows"}
set doorLst to {"Return to subject list...", "Door 1", "Door 2"}
set windowLst to {"Return to subject list...", "Window 1", "Window 2"}
repeat
set subjectAnswer to choose from list subjectLst with prompt "Choose subject matter..." with title "Choose subject matter..."
if subjectAnswer is false then error number -128
if subjectAnswer = {"Doors"} then
set doorAnswer to choose from list doorLst with prompt "Choose comment..." with title "Doors..."
if doorAnswer is false then error number -128
if doorAnswer is not {"Return to subject list..."} then
set the clipboard to item 1 of doorAnswer
return
end if
else if subjectAnswer = {"Windows"} then
set windowAnswer to choose from list windowLst with prompt "Choose comment..." with title "Windows..."
if windowAnswer is false then error number -128
if windowAnswer is not {"Return to subject list..."} then
set the clipboard to item 1 of windowAnswer
return
end if
end if
end repeat
end setClipboard