| Vorheriges Thema anzeigen :: Nächstes Thema anzeigen   | 
	 
	
	
		| Autor | 
		Nachricht | 
	 
	
		spirigwi •----->
  
  
  Anmeldedatum: 10.07.2003 Beiträge: 1517 Wohnort: Olten-CH
  | 
		
			
				 Verfasst am: 06.11.2005 - 19:59    Titel: GUI Scripting-keystroke/Menu OSX + CLASSIC Beispiele | 
				     | 
			 
			
				
  | 
			 
			
				SELBSTBEDIENUNGS-Laden für keystroke-Zeilen des: 
 
(G)UI Scripting = Graphical User Interface Scripting == GUI oder UI Scripting , UIScripting GUIScripting nicht Skripting... mit besonderem Vermerk auf die keystroke Funktion nicht key stroke oder key strock 
 
EDIT 6.8.07
 
 
 
 
Quelle:  
 
 Die Befehle zum UI Scripting: 
 
 Befehlsverzeichnis des Programms  "System Events" und zwar in der "Processes Suite". (Im Editor Tasten APFEL+GROSS+L->  "System Events" anwählen. Damit "System Events" überhaupt erscheint in der Liste, muss vorgehend ein AS gespielt werden, ZB so lautend: tell application "System Events" to ...(samsing).. 
 
 
 
Ein paar keystrokes  ausgeschrieben mit Kurzerklärung:
 
keystroke: cause the target process to behave as if keystrokes were entered
 
   keystroke  Unicode text  -- The keystrokes to be sent.
 
      [using  option down/control down/shift down/command down]  -- modifiers with which the keystrokes are to be entered
 
 
Dass diese wie üblich mit Beispielen maximal geizen, ist bekannt, somit  musste folg.selbst erfunden werden:
 
{command down, shift down} laufen tuts jedenfalls, wenn jemand noch eine Formulierung kennt mit "and"...erwünscht
 
 
 
--Die Ergebnisse entstehen hier beispielhaft in application "Script Editor", ansonsten je nach "Frontmost" Programm, das die Befehle auslösen soll:
 
 
 
BEISPIELE häufiger Tastatur-Befehle mittels AS :
 
on BEISPIELEListe() --oooooooooooooooo 
 
   CODE --= æ_Taste 
 
   AL_S -- keystroke "s" using option down = Alt-Taste mit "S" 
 
   ctrl_y -- keystroke "y" using control down = Control Taste mit "y" 
 
   CODE_S -- keystroke "s" using command down = æ Taste mit "s" 
 
   CODE_GROS_S -- keystroke "s" using {command down, shift down} = æ Taste + Grosstell-Taste mit "s" 
 
   ENTER --keystroke return 
 
   
 
   tell application "Script Editor"
 
      tell application "System Events"
 
         keystroke "s" using option down --AL_S
 
         keystroke "y" using control down --ctrl_y --> past den Zwischenspeicher-Inhalt und blendet Skripteditor aus 
 
         keystroke "s" using command down --CODE_S-->speichern
 
         keystroke "s" using {command down, shift down} --CODE_GROS_S -->Speichern als..save as 
 
         keystroke return --ENTER 
 
      end tell
 
   end tell
 
end BEISPIELEListe
 
 
my BEISPIELtestER() --oooooooooooooooo 
 
on BEISPIELtestER() --oooooooooooooooo 
 
   tell application "Script Editor"
 
      tell application "System Events"
 
         --TEST-key stroke: 
 
         
 
      end tell
 
   end tell
 
end BEISPIELtestER
 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
PS für unverbesserliche wie mich:
 
Naturwissenschafter haben den Begriff: Chimäre geprägt
 
Dies entspricht auf OSX-Rechnern den OSX_CLASSIC-usern(<= der OS9-ers harten Kern): für diese noch ein Hinweis:(da diese zwar meist die ganz cleveren Burschen sind, ist eh jeder Hinweis soviel Wert wie einem Meer das Hineinpissen einer Maus    hallo Freunde,  somit nur ein  PS für     )
 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
 
Wenn der OSX Rechner ein Programm laufen hat das nur CLASSIC geht, kann man folgmassen vorgehen mit SändisAdditions(s. linkseite von SNOW) installiert im OS9-System Ordner:
 
 
 	  OS9 Variante auf einem CLASSIC-Rechner
 
Beispiel welches Fenster des Oldie-Programmes OMNIS schliesst:  hat Folgendes geschrieben: | 	 		  --tell application "System Events"
 
tell application AppOM to activate --"OMNIS 7" ein nur CLASSIC und OS9 laufendes Programm
 
--keystroke "w" using command down
 
tell application AppOM to display dialog "xx"
 
tell application AppOM to TypeText "w" with Command
 
--end tell  | 	  
 
Damit man sowas überhaupt auf dem OSX-Rechner(MacMINI ZB) kompilieren kann, nimmt man dort die CLASSIC-Version von Smile(s. linkseite von SNOW)
 
 
PS PS
 
Folg Satz könnte auf MacMINI(=OSX>>>>1) könnte launch-Fehler bringen:
 
tell application AppOM to activate --"OMNIS 7" ein nur CLASSIC und OS9
 
  	  | Fehlermeldung hat Folgendes geschrieben: | 	 		  | The application "(null)" could not be launched because of a shared library error: ""<Omnis><Omnis><ObjectSupportLib><>"  | 	  
 
Abhilfe:
 
 
tell application "Finder"
 
   set PfOm to ((first item of (list disks)) as string) & ":" & ¬
 
      "Applications:AdvaNCedCoNCepts:Omnis:OMNIS 7"
 
   open file PfOm --für FILE! --oder Alias
 
end tell
 
set AppOM to PfOm
 
tell application AppOM to activate
 
--"OMNIS 7" ein nur CLASSIC und OS9 lauchbares Programm
 
--Der korrekte Finderpfad öffnet das programm und dient gleichzeitig als launcher!!
 
 
Ende gut, alles gut! _________________  Skript-Fan => ein  �  -Fan =>Scr¿¿-KongFuSius_Kurpfusius
  Zuletzt bearbeitet von spirigwi am 07.08.2007 - 13:27, insgesamt 31-mal bearbeitet | 
			 
		  | 
	 
	
		| Nach oben | 
		 | 
	 
	
		  | 
	 
	
		spirigwi •----->
  
  
  Anmeldedatum: 10.07.2003 Beiträge: 1517 Wohnort: Olten-CH
  | 
		
			
				 Verfasst am: 12.11.2005 - 13:19    Titel:  | 
				     | 
			 
			
				
  | 
			 
			
				xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
http://www.apple.com/applescript/uiscripting/03.html
 
 
Beispiel dort: nicht wahnsinnig hilfreich scheint mir:
 
 
on do_menu(app_name, menu_name, menu_item)
 
   try
 
      -- bring the target application to the front
 
      tell application app_name
 
         activate
 
      end tell
 
      tell application "System Events"
 
         tell process app_name
 
            tell menu bar 1
 
               tell menu bar item menu_name
 
                  tell menu menu_name
 
                     click menu item menu_item
 
                  end tell
 
               end tell
 
            end tell
 
         end tell
 
      end tell
 
      return true
 
   on error error_message
 
      return false
 
   end try
 
end do_menu
 
 
Hier gehts dann eher ein bisschen zur Sache Keystroke:
 
 
  display dialog "Import an image file or a folder of images:" buttons {"Cancel", "Folder", "Image"} default button 3
 
if the button returned of the result is "Folder" then
 
   set this_item to choose folder
 
else
 
   set this_item to choose file of type {"JPEG"}
 
end if
 
-- convert the file reference to UNIX style
 
set this_path to the POSIX path of this_item
 
tell application "iPhoto" to activate
 
tell application "System Events"
 
   tell process "iPhoto"
 
      -- open import dialog
 
       keystroke  "I" using {command down, shift down}
 
      -- summon path input sheet¿¿was hiess scheisse schon wieder auf englisch¿¿
 
       keystroke   "/" using control down
 
      delay 1
 
      tell window "Import Photos"
 
         tell sheet 1
 
            set value of text field 1 to this_path
 
            click button 1
 
         end tell
 
         click button 1
 
      end tell
 
   end tell
 
end tell  _________________  Skript-Fan => ein  �  -Fan =>Scr¿¿-KongFuSius_Kurpfusius | 
			 
		  | 
	 
	
		| Nach oben | 
		 | 
	 
	
		  | 
	 
	
		spirigwi •----->
  
  
  Anmeldedatum: 10.07.2003 Beiträge: 1517 Wohnort: Olten-CH
  | 
		
			
				 Verfasst am: 12.01.2006 - 22:30    Titel:  | 
				     | 
			 
			
				
  | 
			 
			
				NACHLASS(opus posthum...)
 
Hier findet man noch  Beispiele vom allerfeinsten in Snows Forum
 
Es geht um Druckerdialog mit :
 
http://www.fischer-bayern.de/phpBB2/viewtopic.php?t=1813&postdays=0&postorder=asc&start=15
 
 	  | hweber hat Folgendes geschrieben: | 	 		  tell application "System Preferences" 
 
   activate 
 
   delay 2 
 
   set the current pane to pane "com.apple.preference.keyboard" 
 
end tell 
 
 
tell application "System Events" 
 
   tell the application process "System Preferences" 
 
      tell window 1 
 
         tell tab group 1 
 
            delay 1 
 
            click radio button "Tastatur-Kurzbefehle" 
 
            delay 1 
 
            tell radio group 1 
 
               click radio button "Alle Steuerungen" 
 
            end tell 
 
         end tell 
 
      end tell 
 
   end tell 
 
end tell  
 
--Jetzt kann man alle Teile eines Dialoges via keystrokes erreichen.  
 
 
 | 	  
 
und dann noch
 
http://www.fischer-bayern.de/phpBB2/viewtopic.php?t=1834
 
 
 	  | hweber hat Folgendes geschrieben: | 	 		  OSX1043 
 
Code: 
 
tell application "FileMaker Developer" 
 
   activate 
 
   go to layout "aa" of window 1 of database "bb.fp7" 
 
   set file_name to cellValue of cell "cc" of current record of window 1 of database "bb.fp7" 
 
   display dialog "Soll vom Datensatz " & file_name & " ein PDF geschrieben werden?"  
 
   if button returned of result is "OK" then  
 
      tell application "System Events" 
 
         keystroke "p" using {command down} 
 
         delay 2 
 
         repeat 5 times 
 
            key code 48 
 
         end repeat 
 
         key code 49 
 
         key code 125 
 
         key code 49 
 
         delay 2 
 
         keystroke file_name 
 
      end tell  
 
   end if  
 
end tell  | 	 
  _________________  Skript-Fan => ein  �  -Fan =>Scr¿¿-KongFuSius_Kurpfusius | 
			 
		  | 
	 
	
		| Nach oben | 
		 | 
	 
	
		  | 
	 
	
		spirigwi •----->
  
  
  Anmeldedatum: 10.07.2003 Beiträge: 1517 Wohnort: Olten-CH
  | 
		
			
				 Verfasst am: 01.08.2007 - 04:03    Titel:  | 
				     | 
			 
			
				
  | 
			 
			
				noch eine mir wichtig scheinende alternativlose Anwendung des OSX4:(ausser man geht mit shell direkt an die metadaten):
 
 	  Wirklich knifflig scheint mir die Spotlight Handhabe:
 
 hat Folgendes geschrieben: | 	 		  --Das Spotlight-Fenster kann während einem Dialog Finderobjekte anwählen!(Apfel+R) 
 
--Hier Apples Standardeingaben für Spotlight Tastatur-Kürzel: 
 
--Gerüst: keystroke "" using {} 
 
set KeyBuchstabe to " " --Leertaste 
 
-- Standard für Spotlight-Menu =[APFEL + Leertaste] 
 
set KeyPlus_Spotlight_Menu to {command down} -->spotlight-Menu 
 
-- Standard für Spotlight-Fenster =[APFEL + Alt+ Leertaste] 
 
set KeyPlus_Spotlight_Fenster to {command down, option down} -->spotlight Fenster 
 
set SuchText_1 to "Snow"
 
set SuchText_2 to "System Events"
 
----------------------------- 
 
tell application "System Events"
 
   keystroke KeyBuchstabe using KeyPlus_Spotlight_Menu as list
 
   tell application "Finder" to tell application "System Events" to ¬
 
      keystroke SuchText_1 --"System Events" lohnt sich, sonst schreibt irgendwohin
 
   delay 3
 
   (display dialog "Soll ich ins Spotlight-Fenster wechseln?")
 
   --der Dialog bremst die folg. Befehle (gottseidank) aus.
 
   if button returned of result is 1 then return
 
   keystroke KeyBuchstabe using KeyPlus_Spotlight_Menu as list
 
   --keystroke return
 
   keystroke KeyBuchstabe using KeyPlus_Spotlight_Fenster as list
 
   delay 3
 
   tell application "Finder" to tell application "System Events" to ¬
 
      keystroke SuchText_2 --"System Events" lohnt sich, sonst schreibt irgendwohin 
 
   activate
 
   delay 2 --<--somit kommt Finder dialog vor das Fenster 
 
   display dialog "Soll ich Spotlight_Fenster schliessen?" & return & "dieser Dialog schwebt! und lässt dich in Ruhe
 
   [APFEL + R] (ev mehrmals) führt dich aufs Finder-Ziel"
 
   --der Dialog bremst die folg. Befehle (gottseidank) aus.
 
   if button returned of result is 1 then return
 
   activate
 
   keystroke KeyBuchstabe using KeyPlus_Spotlight_Fenster as list
 
   tell application "Finder" to tell application "System Events" to ¬
 
      keystroke "w" using {command down}
 
end tell --Ps: von zuverlässig keine Spur aber dennoch praktisch
 
  | 	   
 
Das schöne daran scheint mir, das Finder-Dialog-Fenster verhält sich neutral (flotant) und nicht so bockig wie üblich
 
 
Hier also eine Idee, wie man kombinierte Komandos in Variablen verpacken kann. (Sinn: viel leichter damit einen AS-Fan mit schlechtem Kurzgedächtnis anzuweisen, welche Variable er nehmen muss für bestimmte keystrok-Ziele) _________________  Skript-Fan => ein  �  -Fan =>Scr¿¿-KongFuSius_Kurpfusius | 
			 
		  | 
	 
	
		| Nach oben | 
		 | 
	 
	
		  | 
	 
	
		bernardprejean •->
  
 
  Anmeldedatum: 25.01.2021 Beiträge: 2 Wohnort: Tours,France
  | 
		
			
				 Verfasst am: 25.01.2021 - 20:40    Titel:  | 
				     | 
			 
			
				
  | 
			 
			
				Toll, das gefällt mir! _________________ Bei der Auswahl eines Brokers müssen Sie sich zumindest grob vorstellen, wie oft und in welchem Umfang Sie in den Markt eintreten möchten. | 
			 
		  | 
	 
	
		| Nach oben | 
		 | 
	 
	
		  | 
	 
	
		MatsukenDG •-->
  
 
  Anmeldedatum: 11.09.2020 Beiträge: 101
 
  | 
		
			
				 Verfasst am: 29.03.2022 - 10:31    Titel:  | 
				     | 
			 
			
				
  | 
			 
			
				| Se non riesci a risolvere i problemi ai genitali e non sai quale medicina è meglio scegliere? Allora perché non vai a questa pagina sito ? Ecco la soluzione a tutti i problemi di Cheno | 
			 
		  | 
	 
	
		| Nach oben | 
		 | 
	 
	
		  | 
	 
	
		Nishaknapp •--->
  
 
  Anmeldedatum: 16.03.2022 Beiträge: 217
 
  | 
		 | 
	 
	
		| Nach oben | 
		 | 
	 
	
		  | 
	 
	
		 | 
	 
 
  
	 
	    
	   | 
	
Du kannst keine Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum nicht antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen.
  | 
   
 
  
Powered by phpBB  © 2001, 2002 phpBB Group Deutsche Übersetzung von phpBB.de 
		 | 
	 
 
 | 
 
 |