Applescript Fails in Standalone on Mac Built with 8.1.6

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Applescript Fails in Standalone on Mac Built with 8.1.6

Ben Rubinstein via use-livecode
OK got bit again by this one

We do a lot of of in-house production tools that require our big server on the LAN to be mounted.

For years I just kept a custom prop in these stacks

uMountServer

tell application "Finder"
mount volume "afp://###ServerIP###/###Volume###" as user name "###ServerUser###" with password "###ServerPassword###"
end tell


different stacks will prompt users for IP, USER, PWD  or in some cases I will hard wire these  into the startup script.

This *always* works in my old apps that were made with "only Gawd knows what old version of LC <7" standalones made long time ago.

but now, in 8.1.6  I can set this up in the IDE, the serve ron the LAN mounts as expected, but when I make a standalone, it fails.

I'm looking through all the inclusions and I don't see any external that I need to check for execution of

do tScript as Applescript

this, which, as said, works find in the IDE

(actuall log in creds replaced here for security)

on mountServer
if not (there is a folder (the uServerPath of this stack)) then
-- set the itemdel to "/"
-- put item 3 of the uServerPath of this stack into tVolume
ShowStatusMsg ("Mounting Server..."), true
put the uMountServer of this stack into tScript
replace "###ServerIP###" with (the uServerIP of this stack) in tScript
replace "###Volume###" with "-------" in tScript
replace "###ServerUser###" with "--------" in tScript
replace "###ServerPassword###" with "-------" in tScript
# put tScript   -- check to see that we are getting the right login set up …
do tScript as applescript
end if
end mountServer



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Applescript Fails in Standalone on Mac Built with 8.1.6

Ben Rubinstein via use-livecode
I added some logging on the card and in the standalone we see

this

   do tScript as applescript
      put the result into pMessage
        ShowStatusMsg pMessage, true, true

returns "execution error"

So, why does apple script return execution error when run from 8.1.6 standalones?
 

On 8/17/17, 7:03 PM, "use-livecode on behalf of Sannyasin Brahmanathaswami via use-livecode" <[hidden email] on behalf of [hidden email]> wrote:

    OK got bit again by this one
   
    We do a lot of of in-house production tools that require our big server on the LAN to be mounted.
   
    For years I just kept a custom prop in these stacks
   
    uMountServer
   
    tell application "Finder"
    mount volume "afp://###ServerIP###/###Volume###" as user name "###ServerUser###" with password "###ServerPassword###"
    end tell
   
   
    different stacks will prompt users for IP, USER, PWD  or in some cases I will hard wire these  into the startup script.
   
    This *always* works in my old apps that were made with "only Gawd knows what old version of LC <7" standalones made long time ago.
   
    but now, in 8.1.6  I can set this up in the IDE, the serve ron the LAN mounts as expected, but when I make a standalone, it fails.
   
    I'm looking through all the inclusions and I don't see any external that I need to check for execution of
   
    do tScript as Applescript
   
    this, which, as said, works find in the IDE
   
    (actuall log in creds replaced here for security)
   
    on mountServer
    if not (there is a folder (the uServerPath of this stack)) then
    -- set the itemdel to "/"
    -- put item 3 of the uServerPath of this stack into tVolume
    ShowStatusMsg ("Mounting Server..."), true
    put the uMountServer of this stack into tScript
    replace "###ServerIP###" with (the uServerIP of this stack) in tScript
    replace "###Volume###" with "-------" in tScript
    replace "###ServerUser###" with "--------" in tScript
    replace "###ServerPassword###" with "-------" in tScript
    # put tScript   -- check to see that we are getting the right login set up …
    do tScript as applescript
    end if
    end mountServer
   
   
   
    _______________________________________________
    use-livecode mailing list
    [hidden email]
    Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
    http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Applescript Fails in Standalone on Mac Built with 8.1.6

Ben Rubinstein via use-livecode
On 08/17/2017 10:06 PM, Sannyasin Brahmanathaswami via use-livecode wrote:

> So, why does apple script return execution error when run from 8.1.6 standalones?

Looks like the bugfix is on the way:

http://quality.livecode.com/show_bug.cgi?id=16029
--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Applescript Fails in Standalone on Mac Built with 8.1.6

Ben Rubinstein via use-livecode
Mark Wieder wrote:

 > On 08/17/2017 10:06 PM, Sannyasin Brahmanathaswami wrote:
 >
 >> So, why does apple script return execution error when run from 8.1.6
 >> standalones?
 >
 > Looks like the bugfix is on the way:
 >
 > http://quality.livecode.com/show_bug.cgi?id=16029

As far back as I can recall, at least 15 years, the AppleScript
dictionary periodically falls out of the build process.  Now and then we
find yet another release where the AS Dict is missing, later reinstated,
and later absent.

Is there something about AS in the build process that makes that one
resource uniquely difficult to include consistently?

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Applescript Fails in Standalone on Mac Built with 8.1.6

Ben Rubinstein via use-livecode
In reply to this post by Ben Rubinstein via use-livecode
 
 

 I'm so new I can't address the history but seeing where the fix was implemented it should not fall out unless the build process is significantly changed.    It is in the same place all of the language localization files are specified.
 

 
Thanks,
 
Brian
 

 
 

 
>  
> On Aug 18, 2017 at 9:58 AM,  <Richard Gaskin via use-livecode (mailto:[hidden email])>  wrote:
>  
>  
>  
>  Mark Wieder wrote:  >  On 08/17/2017 10:06 PM, Sannyasin Brahmanathaswami wrote:  >   >>  So, why does apple script return execution error when run from 8.1.6  >>  standalones?  >   >  Looks like the bugfix is on the way:  >   >  http://quality.livecode.com/show_bug.cgi?id=16029 As far back as I can recall, at least 15 years, the AppleScript dictionary periodically falls out of the build process. Now and then we find yet another release where the AS Dict is missing, later reinstated, and later absent. Is there something about AS in the build process that makes that one resource uniquely difficult to include consistently? -- Richard Gaskin Fourth World Systems Software Design and Development for the Desktop, Mobile, and the Web ____________________________________________________________________ [hidden email] http://www.FourthWorld.com _______________________________________________ use-livecode mailing list [hidden email] Please visit this url to subscr
ibe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode 
>
>  
 
 
 
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Applescript Fails in Standalone on Mac Built with 8.1.6

Ben Rubinstein via use-livecode
On 2017-08-18 18:14, Brian Milby via use-livecode wrote:
> I'm so new I can't address the history but seeing where the fix was
> implemented it should not fall out unless the build process is
> significantly changed.    It is in the same place all of the language
> localization files are specified.

I can help fill in the history - yes we've broken it always accidentally
on numerous occasions; and then fixed it, and the broken it again, or
didn't really fix it properly or something (I can't make an excuse, or
give a good reason here - other than it just seems to happen
periodically!)

The issue here is that we don't have a test for whether it is working in
each built release - so that is the way to make sure it never happens
again.

@Brian: Would you be willing to write a test for this? It is going to be
a little tricky as it requires IPC (unless you can use send apple event,
to send one to the calling process), but there's an example of us doing
that already in the private data clipboardData test:

on TestClipboardPrivateKey
    set the clipboardData["private"] to "Hello World!"

    TestAssert "private key is present before external change", \
       "private" is among the keys of the clipboardData

    local tHelperFilename
    set the itemDelimiter to slash
    put format("%s/_clipboard_private_setter.livecodescript", \
          _TestPath()) into tHelperFilename
    if the environment is "command line" then
       TestRunStack "-ui", tHelperFilename
    else
       TestRunStack "", tHelperFilename
    end if

    TestAssert "helper changed clipboard externally", the result is 0

    if the platform is "Linux" then
       TestAssertBroken "private key not present after external change",
\
          "private" is not among the keys of the clipboardData, \
          "Bug 19117"
    else
       TestAssert "private key not present after external change", \
          "private" is not among the keys of the clipboardData
    end if
end TestClipboardPrivateKey

This basically uses a sub-process to do something to the clipboard so
that the test process can check whether the private key disappears in
this case.

Warmest Regards,

Mark.

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Applescript Fails in Standalone on Mac Built with 8.1.6

Ben Rubinstein via use-livecode
I'll see if I can figure out a way to make a test like this work.

On Fri, Aug 18, 2017 at 12:01 PM, Mark Waddingham via use-livecode <
[hidden email]> wrote:

> On 2017-08-18 18:14, Brian Milby via use-livecode wrote:
>
>> I'm so new I can't address the history but seeing where the fix was
>> implemented it should not fall out unless the build process is
>> significantly changed.    It is in the same place all of the language
>> localization files are specified.
>>
>
> I can help fill in the history - yes we've broken it always accidentally
> on numerous occasions; and then fixed it, and the broken it again, or
> didn't really fix it properly or something (I can't make an excuse, or give
> a good reason here - other than it just seems to happen periodically!)
>
> The issue here is that we don't have a test for whether it is working in
> each built release - so that is the way to make sure it never happens again.
>
> @Brian: Would you be willing to write a test for this? It is going to be a
> little tricky as it requires IPC (unless you can use send apple event, to
> send one to the calling process), but there's an example of us doing that
> already in the private data clipboardData test:
>
> on TestClipboardPrivateKey
>    set the clipboardData["private"] to "Hello World!"
>
>    TestAssert "private key is present before external change", \
>       "private" is among the keys of the clipboardData
>
>    local tHelperFilename
>    set the itemDelimiter to slash
>    put format("%s/_clipboard_private_setter.livecodescript", \
>          _TestPath()) into tHelperFilename
>    if the environment is "command line" then
>       TestRunStack "-ui", tHelperFilename
>    else
>       TestRunStack "", tHelperFilename
>    end if
>
>    TestAssert "helper changed clipboard externally", the result is 0
>
>    if the platform is "Linux" then
>       TestAssertBroken "private key not present after external change", \
>          "private" is not among the keys of the clipboardData, \
>          "Bug 19117"
>    else
>       TestAssert "private key not present after external change", \
>          "private" is not among the keys of the clipboardData
>    end if
> end TestClipboardPrivateKey
>
> This basically uses a sub-process to do something to the clipboard so that
> the test process can check whether the private key disappears in this case.
>
> Warmest Regards,
>
> Mark.
>
> --
> Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode