1-- Copyright (c) 2010 The Chromium Authors. All rights reserved. 2-- Use of this source code is governed by a BSD-style license that can be 3-- found in the LICENSE file. 4 5-- Contains some common tab manipulation commands. 6tell application "Chromium" 7 tell window 1 to make new tab with properties {URL:"http://google.com"} 8 -- create a new tab and navigate to a particular URL. 9 10 set var to active tab index of window 1 11 set active tab index of window 1 to (var - 1) -- Select the previous tab. 12 13 set var to active tab index of window 1 14 set active tab index of window 1 to (var + 1) -- Select the next tab. 15 16 get title of tab 1 of window 1 -- Get the URL that the user can see. 17 18 get loading of tab 1 of window 1 -- Check if a tab is loading. 19 20 -- Common edit/manipulation commands. 21 tell tab 1 of window 1 22 undo 23 24 redo 25 26 cut selection -- Cut a piece of text and place it on the system clipboard. 27 28 copy selection -- Copy a piece of text and place it on the system clipboard. 29 30 paste selection -- Paste a text from the system clipboard. 31 32 select all 33 end tell 34 35 -- Common navigation commands. 36 tell tab 1 of window 1 37 go back 38 39 go forward 40 41 reload 42 43 stop 44 end tell 45end tell 46