Peter Wagemans Posted March 1, 2006 Share Posted March 1, 2006 Ik ben een AppleScript applicatie aan het bouwen die met FileMaker babbelt en moet weten in mijn code wat de naam van het actieve venster is. De code tell application "FileMaker Pro Advanced" name of front document end tell blijkt niet te werken, ik krijg de naam van een achterliggend venster. Iemand een idee hoe ik dit best aanpak? Quote Link to comment
0 Andreeke Posted March 1, 2006 Share Posted March 1, 2006 Hoi Peter, Probeer eens: tell application "FileMaker Pro Advanced" name of front window end tell -- André Quote Link to comment
0 EasyKoen Posted March 1, 2006 Share Posted March 1, 2006 Peter, ipv document kan je window gebruiken, dan krijg je de naam van het actieve venster. Bij document lijkt het steeds de laatst geopende bestandsnaam weer te geven... raar! tell application "FileMaker Pro Advanced" name of front window end tell Quote Link to comment
0 Peter Wagemans Posted March 1, 2006 Author Share Posted March 1, 2006 Hey dreeke, weer een tijdje geleden! Bedankt voor de tip, hij werkt! Probleem was natuurlijk dat ik de echte documentnamen moest hebben, FileMaker Pro voorziet standaard geen "document of front window" methode. Ik stak volgende routinetje in mekaar om het toch op te kunnen vragen. Misschien iemand die een "whose" constructie in mekaar kan steken, zodat ik niet door de documenten moet lopen? Nogmaals bedankt André. to GetFrontDocument() tell application "FileMaker Pro Advanced" repeat with theDocument in (every document) repeat with theWindowName in (name of every window of theDocument) if ((theWindowName as text) is (name of front window)) then return theDocument end repeat end repeat return "?" end tell end GetFrontDocument name of GetFrontDocument() Quote Link to comment
0 Peter Wagemans Posted March 1, 2006 Author Share Posted March 1, 2006 Hoi Koen - jouw boodschap zie ik nu pas. Het is inderdaad nogal raar, niet? Bovenstaand routinetje laat ook ruimte voor fouten, in het speciale gevalleke dat er 2 windows met dezelfde naam een verschillend document hebben... Quote Link to comment
0 Peter Wagemans Posted March 9, 2006 Author Share Posted March 9, 2006 Bovenstaand routinetje laat ook ruimte voor fouten, in het speciale gevalleke dat er 2 windows met dezelfde naam een verschillend document hebben... Hier vond ik een simpele oplossing voor: to GetFrontDocument() tell application "FileMaker Pro Advanced" repeat with theDocument in (every document) repeat with theWindowIndex in (index of every window of theDocument) if ((theWindowIndex as integer) is (index of front window)) then return theDocument end repeat end repeat return "?" end tell end GetFrontDocument name of GetFrontDocument() BTW, ik heb net een mailtje gekregen van de mannen van LateNight Software gekregen: It is with great pride that we announce the release of Script Debugger 4.0!More than three years in the making, 4.0 was substantially reworked to take full advantage of Mac OS X technologies and to recognize changes in AppleScript under OS X. View the more than 20 new features that Script Debugger 4.0 offers at: http://www.latenightsw.com/sd4/index.html Try out the demo at: http://www.latenightsw.com/sd4/download.html If you own Script Debugger 3.0, you can upgrade to version 4.0 for US$99 at: http://www.latenightsw.com/sd4/buy.html Die demo moet je zeker eens bekijken. Ik heb niet getwijfeld om te upgraden. Quote Link to comment
Question
Peter Wagemans
Ik ben een AppleScript applicatie aan het bouwen die met FileMaker babbelt en moet weten in mijn code wat de naam van het actieve venster is.
De code
blijkt niet te werken, ik krijg de naam van een achterliggend venster.
Iemand een idee hoe ik dit best aanpak?
Link to comment
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.