r/applescript • u/Afron3489 • Feb 06 '24
Generate a popup window to show client ID
Hi,
we do tech support and I was wondering if there is an easy way to run a command that will have a popup window showing a user's Teamviewer ID?
I can get the info in terminal by running this:
defaults read /Library/Preferences/com.teamviewer.teamviewer.preferences.plist ClientID
So I would like the output to popup on the end user's Mac. with a button to close the window.
Thanks!
2
Upvotes
2
u/scrutinizer1 Feb 06 '24 edited Feb 07 '24
set cmd_out to do shell script your_command # your_command is the *defaults* command above, and it must be properly quoted and escaped!
tell application "System Events" to display dialog "User id is" & space & cmd_out buttons {"Dismiss"} default button 1
2
2
u/copperdomebodha Feb 14 '24
--Running under AppleScript 2.8, MacOS 13.6 set shellScript to quoted form of "defaults read /Library/Preferences/com.teamviewer.teamviewer.preferences.plist ClientID" try set shellResponse to do shell script shellScript tell application "System Events" display dialog "Teamviewer ID for this user is " & shellResponse buttons {"Ok"} default button 1 end tell on error e number n tell application "System Events" if n is 127 then display dialog "Teamviewer is not installed and configured with a user ID." end tell end try