• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Is same not the same?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is same not the same?


  • Subject: Is same not the same?
  • From: Iurista GmbH <email@hidden>
  • Date: Fri, 18 Mar 2016 14:01:17 +0100

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




 _______________________________________________
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


  • Follow-Ups:
    • Re: Is same not the same?
      • From: "S. J. Cunningham" <email@hidden>
    • Re: Is same not the same?
      • From: Yvan KOENIG <email@hidden>
  • Prev by Date: Re: Word 2011 - Executing VBA from an AppleScript?
  • Next by Date: Re: Is same not the same?
  • Previous by thread: Re: Word 2011 - Executing VBA from an AppleScript?
  • Next by thread: Re: Is same not the same?
  • Index(es):
    • Date
    • Thread