help
help
- Subject: help
- From: Julie Roggenbuck <email@hidden>
- Date: Fri, 23 Sep 2016 11:03:35 -0500
If you have any questions or concerns please
email or call
Thanks so much,
remove me
Julie Roggenbuck
Operations Engineer
715-261-9007
Cell# 715-551-6310
From:
| email@hidden
|
To:
| email@hidden
|
Date:
| 09/23/2016
09:33 AM
|
Subject:
| AppleScript-Users
Digest, Vol 13, Issue 400
|
Sent
by:
| applescript-users-bounces+jroggenbuck=email@hidden |
Send AppleScript-Users mailing list submissions to
email@hidden
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.apple.com/mailman/listinfo/applescript-users
or, via email, send a message with subject or body 'help' to
email@hidden
You can reach the person managing the list at
email@hidden
When replying, please edit your Subject line so it is more specific
than "Re: Contents of AppleScript-Users digest..."
Today's Topics:
1. Re: Localization problem. (Yvan KOENIG)
2. Sierra and URLByDeletingLastPathComponent (Yvan KOENIG)
3. Re: Sierra kills ASObjC Runner (Robert Poland)
4. Re: Sierra and URLByDeletingLastPathComponent (Shane Stanley)
5. Re: Sierra kills ASObjC Runner (Shane Stanley)
6. Re: Sierra kills ASObjC Runner (Yvan KOENIG)
----------------------------------------------------------------------
Message: 1
Date: Fri, 23 Sep 2016 11:35:04 +0200
From: Yvan KOENIG <email@hidden>
To: liste AppleScript US <email@hidden>
Subject: Re: Localization problem.
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii
I booted in 10.10.6 in Deutsch and in Spanish.
In both, the description was returned as "alert".
The correct localized German version is "Warnung" and the Spanish
it's "aviso"
Yvan KOENIG running Sierra 10.12.0 in French (VALLAURIS, France) vendredi
23 septembre 2016 11:33:43
------------------------------
Message: 2
Date: Fri, 23 Sep 2016 15:36:01 +0200
From: Yvan KOENIG <email@hidden>
To: liste AppleScript US <email@hidden>
Subject: Sierra and URLByDeletingLastPathComponent
Message-ID: <email@hidden>
Content-Type: text/plain; charset="utf-8"
Hello
When I ran it for the first time one of my scripts under Sierra, I discovered
that it failed.
Looking carefully at the History, I understood what was the wrongdoer.
In this script, I used this handler :
#=====
on getNameAndContainer:PosixPath
local theURL, PosixContainer, PosixName
--|-- log "Entre dans getNameAndContainer"
set theURL to current application's |NSURL|'s fileURLWithPath:PosixPath
set PosixContainer to theURL's URLByDeletingLastPathComponent()
set PosixName to theURL's lastPathComponent()
# set {theResult, theNameHfs} to (theURL's getResourceValue:(reference)
forKey:(current application's NSURLLocalizedNameKey) |error|:(missing value))
# pour un nom Hfs
return {PosixName as text, POSIX path of (PosixContainer as text)}
end getNameAndContainer:
#=====
The second returned value is a posix path of a folder which ended with
a slash.
With Sierra, the ending slash was missing. So, to get rid of that and keep
my script able to run under 10.10, 10.11 and 10.12 I edited the handler
as :
#=====
on getNameAndContainer:PosixPath
local theURL, PosixContainer, PosixName
--|-- log "Entre dans getNameAndContainer"
set theURL to current application's |NSURL|'s fileURLWithPath:PosixPath
set PosixContainer to theURL's URLByDeletingLastPathComponent()
set PosixName to theURL's lastPathComponent()
# set {theResult, theNameHfs} to (theURL's getResourceValue:(reference)
forKey:(current application's NSURLLocalizedNameKey) |error|:(missing value))
# pour un nom Hfs
--return {PosixName as text, POSIX path of (PosixContainer as text)} #
Original last instruction
set PosixContainer to PosixContainer's |path|() as text
# ATTENTION, Sierra ne met pas le / final
if PosixContainer does not end with "/" then set PosixContainer
to PosixContainer & "/"
return {PosixName as text, PosixContainer}
end getNameAndContainer:
#=====
Yvan KOENIG running Sierra 10.12.0 in French (VALLAURIS, France) vendredi
23 septembre 2016 15:35:42
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.apple.com/mailman/private/applescript-users/attachments/20160923/24e2adfe/attachment.html>
------------------------------
Message: 3
Date: Fri, 23 Sep 2016 07:40:10 -0600
From: Robert Poland <email@hidden>
To: Shane Stanley <email@hidden>
Cc: AppleScript Users <email@hidden>
Subject: Re: Sierra kills ASObjC Runner
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii
Thanks Shane,
Not being a master AppleScript programmer, I don't understand the function
of "on checkModifier:keyName"
Consequently I am not able to get a usable output.
> On Sep 22, 2016, at 11:44:PM, Shane Stanley <email@hidden>
wrote:
>
> On 23 Sep. 2016, at 12:05 pm, Robert Poland <email@hidden>
wrote:
>>
>> The intent is to catch a key down.
>
> use AppleScript version "2.4" -- Yosemite (10.10) or later
> use framework "Foundation"
> use framework "AppKit"
> use scripting additions
>
> set optionDown to my checkModifier:"option"
> set shiftKeyDown to my checkModifier:"shift"
> set commandKeyDown to my checkModifier:"command"
> set controlKeyDown to my checkModifier:"control"
> if commandKeyDown and optionKeyDown and controlKeyDown then
> --
> end if
>
> on checkModifier:keyName
> if
keyName = "option" then
>
set theMask to current application's NSAlternateKeyMask as integer
> else
if keyName = "control" then
>
set theMask to current application's NSControlKeyMask as integer
> else
if keyName = "command" then
>
set theMask to current application's NSCommandKeyMask as integer
> else
if keyName = "shift" then
>
set theMask to current application's NSShiftKeyMask as integer
> else
>
return false
> end
if
> set
theFlag to current application's NSEvent's modifierFlags() as integer
> return
(((theFlag div theMask) mod 2) = 1)
> end checkModifier:
>
> --
> Shane Stanley <email@hidden>
> <www.macosxautomation.com/applescript/apps/>,
<latenightsw.com>
Robert Poland
Fort Collins, CO
------------------------------
Message: 4
Date: Fri, 23 Sep 2016 23:49:58 +1000
From: Shane Stanley <email@hidden>
To: AS users <email@hidden>
Subject: Re: Sierra and URLByDeletingLastPathComponent
Message-ID: <email@hidden>
Content-Type: text/plain; charset="utf-8"
On 23 Sep. 2016, at 11:36 pm, Yvan KOENIG <email@hidden> wrote:
>
> return
{PosixName as text, POSIX path of (PosixContainer as text)}
I'm a bit surprised that worked at all, given that PosixContainer is a
Cocoa object.
> With Sierra, the ending slash was missing.
FWIW, POSIX convention is generally not to have a trailing slash.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>,
<latenightsw.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.apple.com/mailman/private/applescript-users/attachments/20160923/cb175480/attachment.html>
------------------------------
Message: 5
Date: Fri, 23 Sep 2016 23:53:50 +1000
From: Shane Stanley <email@hidden>
To: AS users <email@hidden>
Subject: Re: Sierra kills ASObjC Runner
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii
On 23 Sep. 2016, at 11:40 pm, Robert Poland <email@hidden> wrote:
>
> Not being a master AppleScript programmer, I don't understand the
function of "on checkModifier:keyName"
It's just an AppleScript handler, called like any other. You could change
it to "on checkModifier(keyName)" if you would prefer.
> Consequently I am not able to get a usable output.
Add the use statements at the very beginning of your script. Add the checkModifier
handler somewhere. Then replace the ASObjC Runner block with the similar
code from my previous post.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>,
<latenightsw.com>
------------------------------
Message: 6
Date: Fri, 23 Sep 2016 16:32:00 +0200
From: Yvan KOENIG <email@hidden>
To: liste AppleScript US <email@hidden>
Subject: Re: Sierra kills ASObjC Runner
Message-ID: <email@hidden>
Content-Type: text/plain; charset="utf-8"
Hello Robert
try this one :
use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use framework "AppKit"
use scripting additions
# A delay allowing you to press one or several modifiers
delay 2
set optionDown to my checkModifier:"option"
say "optionDown is " & optionDown
set shiftKeyDown to my checkModifier:"shift"
say "shiftKeyDown is " & shiftKeyDown
set commandKeyDown to my checkModifier:"command"
say "commandKeyDown is " & commandKeyDown
set controlKeyDown to my checkModifier:"control"
say "controlKeyDown is " & controlKeyDown
on checkModifier:keyName
if keyName = "option" then
set
theMask to current application's NSAlternateKeyMask as integer
else if keyName = "control" then
set
theMask to current application's NSControlKeyMask as integer
else if keyName = "command" then
set
theMask to current application's NSCommandKeyMask as integer
else if keyName = "shift" then
set
theMask to current application's NSShiftKeyMask as integer
else
return
false
end if
set theFlag to current application's NSEvent's modifierFlags() as integer
return (((theFlag div theMask) mod 2) = 1)
end checkModifier:
Yvan KOENIG running Sierra 10.12.0 in French (VALLAURIS, France) vendredi
23 septembre 2016 16:31:55
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.apple.com/mailman/private/applescript-users/attachments/20160923/adc76b18/attachment.html>
------------------------------
_______________________________________________
AppleScript-Users mailing list
email@hidden
https://lists.apple.com/mailman/listinfo/applescript-users
End of AppleScript-Users Digest, Vol 13, Issue 400
**************************************************
_______________________________________________
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