Re: Is same not the same?
Re: Is same not the same?
- Subject: Re: Is same not the same?
- From: Yvan KOENIG <email@hidden>
- Date: Fri, 18 Mar 2016 16:03:39 +0100
> Le 18 mars 2016 à 14:01, Iurista GmbH <email@hidden> a écrit :
>
> I hjave two identical scripts, which do not behave identical. How can that be?
> The Settings: 10.6.8, AppleScript 2.3, a Demo version of FMP 6.03
>
> The test is about GUI scripting: When FMP opens in Demo mode, it displays a window with two buttons allowing to buy the app or to continue with the demo, the latter is default and can be pressed by clicking "return" key.
> AppleScript should do that: open FMP and activating Demo mode.
>
> Script "test1":
> set SD to (path to "boot") as text
> set FMPfad to SD & "Applications:Programme (Users):Software for this MacOS:PPC Software for SL only:6 Büro:app| FileMaker Pro 6:Filemaker Pro.app"
>
> tell application "System Events"
> if exists application process "Filemaker Pro" of application "System Events" then
> tell application "Filemaker Pro" to quit
> else
> open item FMPfad
> tell (application process "Filemaker Pro" of application "System Events") to set its frontmost to true
> repeat until exists window of (application process "Filemaker Pro" of application "System Events")
> delay 1
> end repeat
> tell (application process "Filemaker Pro" of application "System Events") to keystroke return
> end if
> end tell
>
> No problem: the script behaves ALWAYS as expected, FMP is running or quitting
>
> Script "test2":
> set SD to (path to "boot") as text
> set FMPfad to SD & "Applications:Programme (Users):Software for this MacOS:PPC Software for SL only:6 Büro:app| FileMaker Pro 6:Filemaker Pro.app"
>
> tell application "System Events"
> if exists application process "Filemaker Pro" of application "System Events" then
> tell application "Filemaker Pro" to quit
> else
> open item FMPfad
> tell (application process "Filemaker Pro" of application "System Events") to set its frontmost to true
> repeat until exists window of (application process "Filemaker Pro" of application "System Events")
> delay 1
> end repeat
> tell (application process "Filemaker Pro" of application "System Events") to keystroke return
> end if
> end tell
>
> This script fails twice!!
> If FMP is not running, the log shows that script "test2" does not recognize the AXwindow. FMP herefore hangs in the loop and never gets further than its first AXWindow.
> (therefore: Line 7 does not work)
>
> If FMP is running, Line 2 & Line 6 produce error.
> Line 2 does not recognize FMP as running, therefore activating the ELSE statement.
> Line 6 then produces this error (translated from german): „System Events“ has received an error: „application process "Filemaker Pro"“ can not be set to „true“.
>
> If I replace the said lines with those of script "test1", the everthing works smooth.
> That's puzzling me: as fas as I can see, the two texts are identical.
> What's the thing going on here?
> Thanks for a hint
>
> Rudolf
May you copy and paste both scripts in a single document of TextEdit.
Select the first occurrence of "Filemaker Pro" (including the quotes), coy it, paste it in the TextEdit Search field.
Launch the search.
I would not be surprised to learn that the search will not "find" every strings supposed to be this one.
Maybe there is a NOBREAK SPACE somewhere or maybe there is a "control char" somewhere.
I got this exact problem yesterdays when I was trying to answer a question in MacScripter.
Yvan KOENIG running El Capitan 10.11.3 in French (VALLAURIS, France) vendredi 18 mars 2016 16:03:33
_______________________________________________
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