• 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
Re: scripting safari and menu items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scripting safari and menu items


  • Subject: Re: scripting safari and menu items
  • From: yvan-koenig <email@hidden>
  • Date: Sun, 13 Feb 2005 16:15:59 +0100


Le 13 févr. 2005 , à 13:40, Christian Vinaa a écrit :

i seem to be lost in a never maze of problems

first i wanted script safari
basically just save the front document

tell application "Safari"
	activate
	open location "http://webcam.aet.ch/traffico/airolo_n.jpg";
save  blabla
end tell


that didnt work

so i tried   menu and menu items

	--tell application "System Events"
	--	tell process "Safari"
	--select menu item 7 of menu 3 of menu bar 1
	--	end tell
	--end tell


Perhaps this may help:

property theApp : "Safari"
property useSubMenu : false

tell application theApp
	activate
	tell application "System Events"
		tell process theApp
			tell menu bar 1
				--set aa to get name of every menu bar item
				(*
				 {"Apple", "Safari", "Fichier", "Édition", ¬
				 "Présentation", "Historique", "Signets", ¬
				 "Fenêtre", "Aide"}
				 *)
				set nmbi to (name of menu bar item 3) as text (* 3 = "Fichier" *)

				tell menu bar item nmbi --"Apple"
					tell menu nmbi --"Apple"
						--set bb to name of every menu item
						(*
						{"Nouvelle fenêtre", "Ouvrir un fichier...", ¬
						"Ouvrir une adresse...", "-", ¬
						"Fermer", "Fermer toutes les fenêtres", ¬
						"Enregistrer sous...", "-", ¬
						"Format d'impression...", "Imprimer..."}
						*)

						if useSubMenu is false then
							set nmi to (name of menu item 7) as text
							click menu item nmi
						else
							tell menu item nmi --"Location"
								tell menu nmi --"Location"
									-- set cc to get name of every menu item
									(*
									{"Automatic", "Configuration (06/11/2004 18:22)",
									missing value, "Préférences de Réseau..."}
									*)
									set nsmi to (name of menu item 1) as text
									click menu item nsmi --"Automatic" --location name
								end tell -- menu nsmi
							end tell -- menu item nsmi
						end if -- useSubMenu

					end tell -- menu nmbi
				end tell --menu bar item nmbi
			end tell -- menu bar 1
		end tell -- process theApp
	end tell -- application System Events
end tell -- application theApp


Yvan KOENIG

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: scripting safari and menu items
      • From: yvan-koenig <email@hidden>
References: 
 >Re: numbers and prefix zero (From: Paul Richardson <email@hidden>)
 >scripting safari and menu items (From: Christian Vinaa <email@hidden>)

  • Prev by Date: Re: scripting safari and menu items
  • Next by Date: Re: Slightly OT: InDesign cells-Great Book available
  • Previous by thread: Re: scripting safari and menu items
  • Next by thread: Re: scripting safari and menu items
  • Index(es):
    • Date
    • Thread