System Events keystroke altering variable case
System Events keystroke altering variable case
- Subject: System Events keystroke altering variable case
- From: mbox via AppleScript-Users <email@hidden>
- Date: Thu, 19 Sep 2019 11:38:39 -0700
Hello,
I'm trying to send a command to Terminal to get the version number of a
Perl module. The script below works except for one small problem which
prevents it from actually completing.
If I print out _command while debugging, it prints properly:
/usr/local/cpanel/3rdparty/perl/528/bin/perl -MFile::Next -e 'print
$File::Next::VERSION . "\n"'
However, the command that gets passed to Terminal via System Events looks like
this:
/usr/local/cpanel/3rdparty/perl/528/bin/perl -Mfile::Next -e 'print
$File::Next::VERSION . "\n"'
Notice the first occurrence of module_name in that command - the word
"file" gets lowercased, which breaks the command in the cli. However the
strange part is that the 2nd occurrence of module_name remains properly
capitalized.
What is System Events keystroke doing to that command? Is there
another way to send this command?
Thank you,
Jenni
Mac OS 10.11.6
tell application "Terminal"
activate
set module_name to the text returned of (display dialog "Enter the
module name" default answer "File::Next")
set _command to "/usr/local/cpanel/3rdparty/perl/528/bin/perl -M" &
module_name & " -e 'print $" & module_name & "::VERSION . \"\\n\"'" as string
tell application "System Events"
keystroke _command
delay 0.1
key code 76
end tell
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden