Re: System Events keystroke altering variable case
Re: System Events keystroke altering variable case
- Subject: Re: System Events keystroke altering variable case
- From: mbox via AppleScript-Users <email@hidden>
- Date: Sat, 21 Sep 2019 08:38:35 -0700
Thank you, Nigel. I ended up going with a do script command. I also
found a better a better way** to get the module version info:
tell application "Terminal"
activate
set module_name to the text returned of (display dialog "Enter the
module name" default answer "Module::Name")
do script "/usr/local/cpanel/3rdparty/perl/528/bin/cpan -D " &
module_name in window 1
end tell
> I doubt that System Events itself is doing anything to lower-case that one
> character on yours. If you get that input consistently rather than as a
> one-off, it really is a mystery. :\
Yes, it happens every time. Very strange. However, I found that if I
add single quote marks around the first occurrence of module_name, then it is
capitalized properly every time:
set _command to "/usr/local/cpanel/3rdparty/perl/528/bin/perl -M'" &
module_name & "' -e 'print $" & module_name & "::VERSION . \"\\n\"'"
> /usr/local/cpanel/3rdparty/perl/528/bin/perl -M'File::Next' -e 'print
> $File::Next::VERSION . "\n"'
BTW, I do need the \n in this command so that there's a newline printed
in Terminal after the version number. Otherwise the prompt gets printed on the
same line, right after the version number, which looks terrible and makes it
hard to read.
> I don't have your third-party perl installation, so I can't test if the perl
> stuff actually works.
If you use cPanel, then you do. They've included newer versions of
Perl for awhile now. However, the point is moot - at least for me - as I'm
weaning myself off Perl and moving entirely to PHP. I'm surprised, but I'm
actually gaining more than I'm losing.
Thanks again to all responders,
Jenni
** meaning that it's a shorter command that works properly, and it gives more
information about the module - not just the version number.
_______________________________________________
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