AppleScript: The Missing Manual

First Edition Januar 2005
ISBN 978-0-596-00850-5
Seiten 350
EUR24.00, SFR39.90


Weitere Informationen zu diesem Buch

Inhaltsverzeichnis | Index | Probekapitel | Kolophon | Rezensionen |
Download der Beispiele |


Index

	
[ Symbols ], [ A ], [ B ], [ C ], [ D ], [ E ], [ F ], [ G ], [ H ], [ I ], [ J ], [ K ], [ L ], [ M ], [ N ], [ O ], [ P ], [ Q ], [ R ], [ S ], [ T ], [ U ], [ V ], [ W ], [ X ], [ Z ],

Symbols[ Top ]
"..." (quotation marks), 47
& (concatenation symbol), 56
(*...*) multi-line comments, 42
- - (single-line comments), 42
/ (used to denote POSIX/Unix file paths), 76
: (used to denote file paths), 76
\ escape symbol, 59
\" escape symbol, 59
\n escape symbol, 59
\r escape symbol, 59
\t escape symbol, 59
~/ (used to denote user's Home folder), 76
¬ (line-continuation symbol), 55
- (ellipsis, creating), 214

A[ Top ]
A class name can't go after this identifier compiler error, 266
AAC audio file format, 153
About Convert/Print Window script, 12
About Finder Scripts submenu, 6
About Internet Services script, 9
About These Scripts command (Script Editor), 28
Accounts command, 11, 77
Action Clauses command (Script Editor), 28
actions (Photoshop)
      recording, 131
      wrapping in AppleScript, 133
Actions command (Photoshop), 132
activate command, 19, 111, 237, 241
Activity Monitor, 109
ADC (Apple Developer Connection), 276
add - new item alert script, 224
Add Bookmark command, 95, 183
add command, 127
Add to File Names script, 7
Add to File/Folder Names script, 6, 8
Address Book
      adding contacts to group, 185
      copying information to FileMaker Pro database, 212-216
      creating group, 186
      dictionary, 185
      writing plug-ins, 184
Address Book Plug-Ins folder, 184
Address Book scripts, 5
Adjustments menu (Photoshop), 133
administrator accounts, 258
Adobe Photoshop CS folder, 132
AE Monitor Web site, 44
AIFF audio file format, 153
AirPort, 174
      cards, 171
      signal strength, 172
alert, folder action, 222
alias keyword, 77
.app files, 31
Apple Events, 44
Apple Human Interface Guidelines (HIG) Web site, 285
Apple Lossless audio file format, 153
Apple online retail shop, 13
Apple Stock Quote (Yahoo) script, 13
Apple Store script, 13
AppleScript
      additional resources, 309-311
      controlling files using, 75
      examples CD, 24
      folder, 3, 6
      home page, 309
      making work with Web services, 200
      numbers, 305
      text handling, 65
      variables, 307
      versus HyperTalk, 303-307
      Web site, 6
.applescript files, 31
AppleScript Help script, 5
AppleScript pane (Inspector), 290
AppleScript Related Sites script, 14
AppleScript Studio, 281-295
      creating new project, 283
      Interface Builder, using with, 285-293
      interface design, 285-293
      overview, 281
      polishing up application, 295
      using Xcode with, 293-295
      Web site, 294
      writing code in, 293
AppleScript Website script, 6
applescript-studio discussion list, 311
applescript-users discussion list, 311
AppleWorks, 299
Application Bundles, 34
application script menus, 12
apply to all subfolders script, 225
as keyword, 271
at the front keywords, 61
Audible Web site, 159
audio file formats, 153
Auto Color command (Photoshop), 133
Auto Contrast command (Photoshop), 133
Auto Levels command (Photoshop), 133
automating button clicks, 241

B[ Top ]
backing up files, 91
Backup 2.0 Web site, 92
Basics folder, 31
batch renaming, 8, 113
beep command, 152
Berkowitz, Paul, 74
black text in Script Editor, 27
Block Pop-Up Windows command, 240, 241
blue text in Script Editor, 27
Bookmarks Bar menu, 183
Boolean values, 91
browsers
      Camino, 176
      Firefox, 176
      iCab, 176
      Internet Explorer, 176
      Mozilla, 176
      Netscape, 176
      OmniWeb, 176
      Opera, 176
      scripting, 176
      (see also Safari)
browsing, 302
Build and Debug command (Xcode), 279
Build and Run command (Xcode), 279, 284, 294
Build command, 294
Build profile info web page script, 6

C[ Top ]
cal command, 257
calendar, 262
call soap command, 200
call xmlrpc command, 200
Camino, 176
Carbon Copy Cloner Web site, 92
Card and Columns command (Address Book), 186
Change Case of Item Names script, 7
Changing Info Color script (DVD Player), 169
chat program (see iChat)
check for new mail command, 187
Check Spelling as You Type command, 28
Check Spelling command, 27
Cheeseman, Bill, 310
choose file command, 77, 97, 134, 197
choose file name command, 196
choose folder command, 98
choose from list command, 191
      every keyword, 109
      merging file lists, 116
choose URL command, 197, 198
chown Unix program, 258
class keyword (AppleScript), 304
Classes list command (Photoshop), 135
clicking tab buttons, 243
the clipboard keywords, 160
Clock command, 157
close - close sub-folders script, 224
CNN script, 14
Cocoa, beginner lessons, 310
coercion operation, 108
coercions, common, 272
colored text in Script Editor, 26
ColorSync folder, 30
ColorSync submenu (Script Menu), 6
command prompt, Unix, 252
Comment Tags command (Script Editor), 28
comments in AppleScript, 27
compiler errors, 266
compiling files, 24
concatenating lists, 115
concatenating strings, 56
Conditionals command (Script Editor), 28
Connect to Server command, 196, 198
convert - PostScript to PDF script, 225
convert command, 155
Convert to PDF/PostScript script, 12
converting music, 153
Copy command, 40, 42, 184
copy command, 215
Copy Phone Number to Clipboard script, 184
CoreServices folder, 138, 258
count command, 67, 238
Count Messages in All Mailboxes script, 10
Crazy Message Text script, 10
Create LDAP Server script, 11
Create New Mail Account script, 11
Create New Message script, 11
cron program, 261, 263
Current Date & Time script, 9
current date command, 62, 63, 156
Current Temperature by Zipcode script, 9
Current Temperature script, 14
Current Work folder, 45
Customize Toolbar command, 25

D[ Top ]
database, AppleScript, 203-217
      getting file information, 206
      making simple, 204-206
      searching, 205
default answers, 54
default responses, 55
Default Voice command, 15
Default Voice tab, 156
defaults command, 253
defaults Unix program, 251
delay command, 151
delete command, 94, 155
Desktop & Screen Saver command, 192
Desktop folder, 77
desktop icons, increasing size, 233
Desktop Pictures folder, 81, 139
Developer Tools
      obtaining and installing, 275
      (see also Xcode)
dialog boxes and scripts, 60
Dialogs command (Script Editor), 28
dictionaries
      checking whether a program has one, 238
      overview, 48
      scripting programs that don't have, 237-250
      (see also program dictionary)
diffuse glow filter (Photoshop), 135
digital cameras, 125
discussion lists, 310
disks, list folder command, 118
Display All Accounts and Preferences script, 11
display dialog command, 266
      buttons option, 60
      default answer option, 54
      default button option, 60
      dialogResponse variable, 60
      displaying numbers, 41
      giving up after option, 60
      lists and, 108
      multiple commands, 41
      scripting additions and, 50
      with icon option, 60
divider bar, 25
do JavaScript command, 180
do script command, 253
do shell script, Unix without Terminal, 256
do Visual Basic command, 74
Documents folder, 93, 225
Download Weather Map script, 14
Drop Box folder, 224
droplets, 141, 154
duplicate command, 92
DVD Player program, 169
DVD Player Scripts folder, 169
DVD scripts, 169

E[ Top ]
Editing pane, 36
editors, 38
      Script Debugger, 38
      Script Editor (see Script Editor)
      TextEdit (see TextEdit)
      Xcode (see Xcode)
else statement, 48
Enable Folder Actions command, 222
end command, 79
end if command, 47, 79
end repeat command, 79
end tell command, 47, 79
Erase Deleted Messages command (Mail), 189
error command, 275
Error Handlers command (Script Editor), 28
error statement tricks Web site, 274
error statements, 274
errors
      discovering, 274
      isolating and handling, 273
      preventing, 271-272
escape sequences, 58
Event Log, 29
Event Log History, 269-271
Event Log History command, 269
event logs, 267-269
Example Scripts icon, 4
examples CD, 24
Execute AppleScript command, 158
exists command, 47, 67, 271
exit repeat command, 271
Expected """ but found end of script compiler error, 266
Expected "tell", etc. but found "if" compiler error, 266
Expected end of line but found " compiler error, 266
Expected end of line but found identifier compiler error, 266
Expected end of line, etc. but found "tell" compiler error, 266
extending AppleScript's menu control, 240

F[ Top ]
file extensions, missing, 7
file information scripts, 206-209
FileMaker Pro
      copying Address Book information to database, 212-216
      creating new database, 210
      entering information into database, 211-216
            manually, 211
      Insert File command, 215
      New Database command, 210
      scripting, 209-217
      ScriptMaker, 217
      Sort Records command, 216
      sorting records, 216-218
files
      backing up, 91
      controlling, 75-103
      deleting, 94
      displaying folders, 78
      extensions, 76, 101
      folders, 76
      moving, 88-90
      paths, 77
            notation, 76
      POSIX, 77
      saving, 100
      saving all documents at once, 103
filter command, 135
filtering database information, 209
filtering images, 135
Find command, 25, 122, 185
Finder scripts, 6-8
Finder Scripts folder, 30
Finder window
      changing view of, 80
      settings, 82
Finder Windows - Hide All script, 7
Finder Windows - Show All script, 7
Firefox, 176
fit to pages command, 69, 70, 71
Flatten Image command (Photoshop), 135
Folder Action Scripts folder, 222, 223, 225
folder actions, 4, 8
Folder Actions Handlers command (Script Editor), 28
folder actions scripts, 221-235
      add - new item alert, 224
      apply to all subfolders, 225
      close - close sub-folders, 224
      convert - PostScript to PDF, 225
      Image - Add Icon, 225
      Image - Duplicate as JPEG/PNG/TIFF, 226
      Image - Flip Horizontal/Vertical, 226
      Image - Info to Comment, 226
      Image - Rotate Left/Right, 226
      open - show comments in dialog, 226
      setup, 234
      subfolders, 225
      Web site, 235
Folder Actions Setup command, 234
Folder Actions Setup icon, 4
Folder Actions submenu, 8
folder icons, 78
Font Sampler script, 9
FontSync profiles, 8
FontSync Scripts submenu, 8
formats, converting, 143
forward command, 190
Full Key Codes, 250
Function Key pop-up menu (Photoshop), 132

G[ Top ]
generate command, 61
Get Info command, 89
Get New Mail command, 187
Get Result of AppleScript command, 73
Get Size of IMAP Mailbox script, 11
get synonym info object command, 122
global Script Menu, 12
global variables, 307
Go to Chapter script (DVD Player), 169
Go to Time script (DVD Player), 169
graphical database program, 209
graphics (see images)
gray text in Script Editor, 27
GUI Scripting, 13, 238-250
      automating button clicks, 241
      clicking tab buttons, 243
      controlling menus, 240
      enabling, 239
      PreFab UI Browser, 247
      System Events, 239

H[ Top ]
handlers (see subroutines)
Hearing tab (System Preferences), 152
HetimaOsaxOpener plug-in, 37
Hide Navigation Bar command, 32
Hide Toolbar command, 26
History pane, 37
History, clearing, 270
HyperCard
      data types, 304
      moving to AppleScript, 303-307
HyperTalk
      checking if files/folders exist, 305
      dialog boxes, 304
      numbers, 305
      pausing scripts, 306
      ranges, 306
      subroutines, 307
      variables, 307
      versus AppleScript, 303-307

I[ Top ]
IBM's ViaVoice, 162
iCal, 176
      New Calendar command, 262
      New Event command, 262
      scheduling scripts with, 262
iChat, 191-195
      modifying when screen saver is on, 191
      status message setting, 193-195
Icons folder, 95
if statement, 89, 111
iLife Web site, 126
Image - Add Icon script, 225
Image - Duplicate as JPEG/PNG/TIFF script, 226
Image - Flip Horizontal/Vertical script, 226
Image - Info to Comment script, 226
Image - Rotate Left/Right script, 226
Image Events, 137-145
      bugs in, 140
Image Events scripts, 137-145
Image Manipulation command (Script Editor), 28
images
      converting, 125
      converting formats, 143
      creating a droplet, 141
      filtering, 135
      getting dimensions, 138
      getting random, 128
      JPEG2 format, 145
      making look surreal, 135
      opening, 125
      organizing and editing, 125-145
      padding, 140
      slideshows, 130
      (see also Photoshop)
Import Addresses script, 11
Importing command (iTunes), 153
Info Field, 29
info for command, 206, 207
      properties, 208
info for record, properties, 208
Info Scripts submenu, 9
information record properties, complete list, 209
inheritance, 83
Insert File command (FileMaker Pro), 215
Inspector, 290
Install Script Menu, 4
instant messaging
      signing up for new account, 191
      (see also iChat)
Interface Builder
      Inspector window, 290
      Quit Application command, 290
      Show Info command, 290
      Test Interface command, 290
      using with AppleScript Studio, 285-293
interface hierarchies, 245-248
Internal Modem command, 172
Internet and network scripts, 171-200
Internet Connect, 171-175
Internet Explorer, 176
Internet Scripts submenu, 9
Internet Services folder, 16
iPhoto scripts, 126-131
it keyword, 136
it statement, 136
Iterate Items command (Script Editor), 28
iTunes
      converting music files, 153
      converting song files, 152
      Library, 153
      Music folder, 154
      playing tracks, 148
      preferences, 153
      rating songs, 148
      scripts, 147-155
      skipping tracks, 150

J[ Top ]
JavaScript code, running in Safari, 180
JPEG2 format, 145

K[ Top ]
key down command, 249, 250
key up command, 249, 250
Keyboard Maestro Web site, 157
keyboard shortcuts
      Actions command (Photoshop), 132
      AppleScript pane (Inspector), 290
      Build and Debug command (Xcode), 279
      Build and Run command (Xcode), 279
      Copy command, 42
      Customize Toolbar command, 25
      Duplicate command, 289
      Event Log History command, 269
      Find command, 185
      Get Info command, 89
      Library command, 46
      Move to Trash command, 96
      New Calendar command (iCal), 262
      New command, 166
      New Event command (iCal), 262
      New Smart Playlist command, 150
      Open Dictionary command, 44
      Paste command, 233
      Quit Application command, 290
      Result History command, 37
      Save As command, 20
      Script Editor Preferences command, 35
      Script Menu, 19
      Select All command, 161
      Show Info command (Interface Builder), 290
      Show View Options command, 233
      Test Interface command, 290
      View Source command, 177
      zooming in and out, 249
Keychains, 199-201
keystroke command, 248

L[ Top ]
Late Night JavaScript Web site, 44
Late Night Software's JavaScript, 180
launch command, 237
Library window, 46
Line Wrap preferences, 36
line-continuation symbol, 55
lists, 105-124
      adding items one at a time, 119
      adding multiple items at once, 119
      additional uses, 124
      as keyword, 108
      batch renaming, 113
      choose application command, 112
      choose from list command, 107
      common commands, 106
      concatenating, 115
      count command, 107
      display dialog command, 113
      displaying, 107
      every keyword, 109
      getting from other programs, 121
      getting selected items, 108
      inputting, 119
      item keyword, 106
      items keyword, 106
      iterating, 112
      list folder command, 118
      list processing, 112
      merging file lists, 116
      Microsoft Word and, 122-124
      nested, 106
      noncontiguous items, 107
      other uses for, 124
      preserving in a variable, 106
      processes, 110
      repeat statement, 113
      repeat with statements, 113
      set command, 106
      single-item, 105
      text item delimiters, 120
      TextEdit and, 121
load script command, 137
log command, 267
logging events, 267-269
Loop Movie script (DVD Player), 169

M[ Top ]
Mac Help command, 171
Mac OS X settings, tweaking hidden, 251
Macintouch script, 14
macscrpt discussion list, 311
MacUpdate Web site, 295
MacWeek script, 14
Mail, 186-191
      checking for new messages, 187
      Erase Deleted Messages command, 189
      finding mailboxes with unread messages, 188-191
      Get Mail button, 187
      mailboxes, 187
      Rules command, 190
      scripts, 10
      special rules feature, 190
make command, 80, 89, 238
      handling errors with, 90
      with properties option, 203
Make New AppleScript command (Safari), 181
make new command, 61
make new document command, 61
Make New Script command, 73
Make Plain Text command, 179
man Unix program, 253
Manage SMTP Servers script, 11
menus, extending AppleScript's menu control, 240
merging file lists, 116
Microsoft Word
      adapting TextEdit scripts, 67
      AppleScript support, 66
      fit to pages command, 69
      lists and, 122-124
      miscounting, 68
      scripting, 66-71
            count and every keywords, 68
Mimic PC monitor script, 6
motion blur filter (Photoshop), 135
move command, 88, 90, 155
Move to Trash command, 96
movies
      including with script, 165
      presenting full-screen, 164
      rotating, 167
      (see also QuickTime)
Movies folder, 166
Mozilla, 176
MP3 audio file format, 153
multi-line comments, 42
multiple script menus, 12
music
      converting, 153
      (see also iTunes)
Music folder, 159, 224
My iDisk command, 197

N[ Top ]
Navigation Bar, 32
Navigation Scripts subfolder, 12
nested lists, 106
Netscape, 176
new album command, 126
New Calendar command (iCal), 262
New Database command (FileMaker Pro), 210
New Event command (iCal), 262
New Finder Window command, 4
New Project command (Xcode), 276
New Smart Album command, 127
New Smart Playlist command, 150
New Tab command, 177
noncontiguous items in a list, 107

O[ Top ]
Old Desktop folder, 90, 233
OmniWeb, 176
      Web site, 302
open - show comments in dialog script, 226
open command, 77, 80
Open Dictionary command, 44, 46, 59, 109, 112
open location command, 175, 176, 199
Open Script Editor script, 6, 21
Open Script Folder script (DVD Player), 169
Open Scripting Architecture Extension (see osax), 50
Open Scripts Folder command, 16
Open URL command, 72
opening folder handler, 230
Opera, 176
osascript command, 260
osax (scripting addition), 50

P[ Top ]
passwords, 197-201
      Keychains, 199-201
Paste command, 233
path notation, 76
PDF format, converting documents to, 125
personal information managers (PIMs), 183
photos (see images)
Photoshop
      Actions command, 132
      Adjustments menu, 133
      Auto Color command, 133
      Auto Contrast command, 133
      Auto Levels command, 133
      Classes list command, 135
      commands, 134
      Filter Suite, 134
      filters, 135
      Flatten Image command, 135
      Function Key pop-up menu, 132
      recording actions, 131
      Save for Web command, 133
      scripts, 131-137
      (see also images)
pico, Unix text editor, 255
pictures (see images)
Pictures folder, 224
play command, 148
playpause command, 148
plug-ins, 37
Plug-ins command, 38
portable operating system interface (POSIX), 77
POSIX files, 77
PreFab UI Browser Web site, 247
Preferred Playback script (DVD Player), 169
present command, 164
      scale option, 165
preserving a list in a variable, 106
Preview, 125
Preview Movie script (DVD Player), 169
Print Window command, 13
Print Window/Window with Subfolders script, 13
printing scripts, 12
Printing Scripts submenu, 12
processes, 110
produce command, 61
program dictionary, 18, 44
      overview, 48
      Standard Suite, 45
programmers, Web site for Apple, 310

Q[ Top ]
QuickTime
      keystrokes, 165
      Player, 164
      scripts, 164-169
      (see also movies)
Quit Application command (Interface Builder), 290
quit command, 237

R[ Top ]
Random Info Color script (DVD Player), 169
random number command, 130
random numbers Web site, 130
ranges, 306
      AppleScript, 306
      HyperTalk, 306
record data type, 203
record notation scripts, 203
recording scripts, 23
Remove profile from image script, 6
Remove Script Menu icon, 4
Repeat Routines command (Script Editor), 28
repeat statement, 70, 71, 151, 271, 306
repeat until statement, 151
Replace Text in Item Names script, 7
reply command, 190
Reset Windows script (DVD Player), 169
Resources folder, 34, 166
Result History command, 37
Retrospect Desktop Web site, 91
reveal command, 96
rotate command, 168
Rule Actions script, 11
Rules command (Mail), 190
Run as AppleScript command (Safari), 74, 180
run script command, 137
run VB macro command, 74

S[ Top ]
Safari, 175-183, 302
      icons, 95
      Make New AppleScript command, 181
      preferences, 176
      Run as AppleScript command, 180
      running JavaScript code in, 180
Save All command, 103
Save As command, 20, 64
Save As PDF command, 34, 125
Save command, 64, 100
      saving all documents at once, 103
      TextEdit and, 102
Save for Web command (Photoshop), 133
say command, 156, 294
      saving to option, 159
.scpt files, 31
screen saver, enabling, 192
screen zooming feature, 249
Script Assistant, 36
Script Bundles, 34
script bundles, 50
Script Debugger, 38
Script Editor, 21-38, 72
      .scpt files, 31
      adding your own shortcut menus, 28
      alternatives, 38
      Application Bundles, 34
      black text, 27
      blue text, 27
      colored text in, 26
      Compile button, 24, 40
      copying code, 73
      divider bar, 25
      Event Log, 29
      folder, 38
      Get Result of AppleScript command, 73
      gray text, 27
      icon, 4
      Info Field, 29
      Library window, 46
      Navigation Bar, 32
      plain text files, 34
      plug-ins, 37
      preferences, 35-38
            Editing, 36
            Formatting, 36
            General, 35
            History, 37
      Preferences command, 35
      Record button, 23
      Run button, 24
      Script Bundles, 34
      Script Field (see Script Field)
      script formats
            applications, 31, 33
            script files, 31
            text documents, 31, 34
      shortcut menus, 28
      starting, 21
      Stop button, 23
      Tabs section, 36
      toolbar, 22-26
Script Field, 26
      shortcut menus, 28
script files, 31
script formats, 30
      applications, 31, 33
      script files, 31
      text documents, 31, 34
Script Menu
      AboutFinder scripts submenu, 6
      adding new scripts, 15
      Address Book scripts, 5
      Basics submenu, 5
            AppleScript Help script, 5
            AppleScript Website script, 6
            Open Script Editor script, 6
      ColorSync submenu, 6
            Build profile info web page script, 6
            Mimic PC monitor script, 6
            Remove profile from image script, 6
      customizing, 14-17
      Finder scripts submenu, 6
            Add to File/Folder Names script, 6
            Change Case of Item Names script, 7
            Finder Windows - Hide All script, 7
            Finder Windows - Show All script, 7
            Replace Text in Item Names script, 7
            Switch to Finder script, 7
            Trim File/Folder Names script, 8
      Folder Actions submenu, 8
      FontSync Scripts submenu, 8
      hidden tricks, 19
      Info Scripts submenu, 9
            Current Date & Time script, 9
            Font Sampler script, 9
      Internet Scripts submenu, 9
            About Internet Services scripts, 9
            Current Temperature by Zipcode script, 9
            Stock Quote script, 9
      Mail Scripts submenu, 10
            Count Messages in All Mailboxes script, 10
            Crazy Message Text script, 10
            Create LDAP Server script, 11
            Create New Mail Account script, 11
            Create New Message script, 11
            Display All Accounts and Preferences script, 11
            Get Size of IMAP Mailbox script, 11
            Import Addresses script, 11
            Manage SMTP Servers script, 11
            Rule Actions script, 11
      Navigation Scripts subfolder, 12
      Printing Scripts submenu, 12
            About Convert/Print Window scripts, 12
            Convert to PDF/PostScript script, 12
            Print Window/Window with Subfolders script, 13
      rearranging submenus, 16, 17
      Script Editor submenu, 13
      Sherlock Scripts submenu, 13
      tricks, 19
      UI Element Scripts submenu, 13
      URLs submenu, 13
            Apple Stock Quote (Yahoo) script, 13
            Apple Store script, 13
            AppleScript Related Sites script, 14
            CNN script, 14
            Download Weather Map script, 14
            Macintouch script, 14
            MacWeek script, 14
script samples
      About Convert/Print Window, 12
      About Internet Services, 9
      Add to File Names, 7
      Add to File/Folder Names, 6, 8
      Apple Stock Quote (Yahoo), 13
      Apple Store, 13
      AppleScript Help, 5
      AppleScript Related Sites, 14
      AppleScript Website, 6
      Build profile info web page, 6
      Change Case of Item Names, 7
      CNN, 14
      Convert to PDF/PostScript, 12
      Count Messages in All Mailboxes, 10
      Crazy Message Text, 10
      Create LDAP Server, 11
      Create New Mail Account, 11
      Create New Message, 11
      Current Date & Time, 9
      Current Temperature, 14
      Current Temperature by Zipcode, 9
      Display All Accounts and Preferences, 11
      Download Weather Map, 14
      Finder Windows - Hide All, 7
      folder action scripts (see folder actions scripts)
      Font Sampler, 9
      Get Size of IMAP Mailbox, 11
      Import Addresses, 11
      Macintouch, 14
      MacWeek, 14
      mail scripts, 10
      Manage SMTP Servers, 11
      Open Script Editor, 6
      Print Window/Window with Subfolders, 13
      printing scripts, 12
      Remove profile from image, 6
      Replace Text in Item Names, 7
      Rule Actions, 11
      Script Editor, 13
      Sherlock scripts, 13
      Stock Quote, 9
      Switch to Finder, 7
      Trim File/Folder Names, 8
      UI scripts, 13
      URL scripts, 13
script support in common programs, 299-302
      AppleWorks, 302
      BBEdit, 301
      Entourage, 300
      Eudora, 300
      FileMaker Pro, 299
      InDesign CS, 301
      iPhoto, 300
      Mail, 300
      Mailsmith, 300
      Nisus Writer Express, 302
      OmniWeb, 302
      OpenOffice, 302
      Photoshop, 300
      QuarkXPress, 301
      Safari, 302
      SubEthaEdit, 301
      Tex-Edit Plus, 302
      TextEdit, 301, 302
      Word, 302
scripting programs that don't have dictionaries, 237-250
ScriptingAdditions folder, 50
ScriptMaker, 217
scripts
      activating program from dialog box, 110
      adapting existing script to be droplet, 142
      adapting TextEdit scripts to Microsoft Word, 67
      adding items to list one at a time, 119
      adding multiple items to list, 119
      automating typing function keys from, 250
      batch renaming, 113
      beeping, 152
      changing network name, 242
      checking for existence of file extension, 114
      checking for new messages in Mail, 187
      checking whether TextEdit has dictionary, 238
      choose application command example, 112
      cleaning desktop, 261
      coercion example, 108
      common list commands
            count command, 107
            item keyword, 106
      concatenation, 115
      converting Clipboard text into audio, 159
      converting images, 143
      converting iTunes files using drag and drop, 154
      counting words, 67
      creating Address Book group, 186
      creating database record, 203
      creating lists, 105
      creating new email message in preferred email program, 199
      default application property, 208
      discovering errors, 274
      displaying iChat status message, 193
      displaying lists, 107
      displaying name of every running program in a dialog box, 110
      displaying other dialog box, 47
      downloading files, 195
      eliminating oversized buttons, 228
      emulating keystrokes, 248
      encoding database records, 205
      extending AppleScript's menu control to any program, 240
      filtering images, 135
      finding Address Book contacts, 185
      finding best Internet signal, 173
      finding mailboxes with unread messages, 188
      finding unrated songs, 149
      fit to pages command example, 69
      folder action (see folder actions scripts)
      getting image dimensions, 138
      getting list of only modified documents from TextEdit, 122
      getting lists from TextEdit, 121
      getting selected item from list, 108
      getting synonyms of a word from Microsoft Word, 122
      handling errors, 273
      identifying name of program that's designated to open particular file, 209
      if statement example, 111
      including movies with, 166
      integrating Address Book with FileMaker Pro, 212
      it statement example, 136
      kind property, 208
      list processing, 113
      listing passwords saved in Keychain, 199
      loading multiple Web sites automatically, 175
      logging notifications, 267
      merging file lists, 116
      moving old desktop files, 233
      name property, 208
      nested lists, 106
      notifying iChat when screen saver is on, 191
      noting important events, 266
      open location command example, 199
      opening a file in pico, 254
      opening folder, 229
      packaging blob-creating Unix command, 254
      padding an image, 140
      pausing, 306
      playing iTunes tracks, 148
      playing slideshow, 131
      QuickTime movie playing modes, 165
      random numbers, 130
      recording, 23
      referring to specific pixel on screen, 124
      repeat statement example, 71
      retrieving password to Keychain key, 200
      rotating movies, 167
      running cal from AppleScript, 257
      running in Safari's Address bar, 181
      running JavaScript code in Safari, 180
      running one script from another, 137
      running Unix program without Terminal, 256
      running uptime from AppleScript, 252
      running uptime in current Terminal window, 253
      saving all documents, 103
      saving all TextEdit documents every 10 minutes, 278
      saving in TextEdit, 102
      scheduling with iCal, 262
      searching AppleScript database, 205
      selecting tab in tab group, 243
      sending files to Trash, 232
      setting status to away only if screen saver is running, 192
      setting values inside database record, 204
      showing QuickTime movie full-screen, 164
      skipping iTunes tracks, 151
      sorting Filemaker records, 217
      speaking current date and time, 156
      speaking from, 156
      speaking into sound file, 159
      storing position and size of window onscreen, 124
      testing exists command, 47
      Text Suite example, 65
      uploading files, 196
      using handlers, 141
      using open command, 49
      using Script Editor's Library, 46
      using speech recognition, 162, 163
      using tell statements, 43
      viewing plain-text version of Web site, 178
      viewing Web site code, 177
      wrapping actions in, 133
      writing Address Book plug-ins, 184
      zooming in and out, 249
Scripts command, 15
Scripts folder, 4, 15, 17
Select All command, 155, 161
Services menu, 72
set command, 54, 293
set the end command, 119
setting up, 3-20
Sharing command, 242
Sherlock scripts, 13
Shopping Lists folder, 225
shortcut menus, 28
shortcuts, AppleScript, 79
Show Info command (Interface Builder), 290
Show Navigation Bar command, 32
Show Song File command, 96
Show Standard Info script (DVD Player), 169
Show Toolbar command, 26
Show View Options command, 88, 233
Show Wide Info script (DVD Player), 169
single-item lists, 105
single-line comments, 42
slideshows, 130
Smart Albums, 127
Smile editor Web site, 38
SOAP scripts, 200
Sort Records command (FileMaker Pro), 216
sorting FileMaker records, 216, 218
sound, 95
sound and video scripts, 147-169
Sound Effects tab, 95, 152
Sounds folder, 117
SpeakToMe, 294
speech
      converting text in Clipboard into audio, 159
      generation, 163
      linking to a keyboard shortcut, 157
      listen for command, 161
      making a file speak, 159
      reading multiple emails, 160
      recognition, 163
      scripts, 155-163
      speaking from a script, 156
Speech Recognition tab, 162
speech-recognition Web site, 163
SpeechRecognitionServer program, 162
standard accounts, 258
Standard Additions dictionary, 209
Start Speaking command, 155
Startup Items pane, 34
Stickies, running services from, 74
Sticky Keys feature, 244
Stock Quote script, 9
String Comparison command (Script Editor), 28
string notation, 54
subroutines, 85-88, 307
      running instead of tell statement, 87
superuser accounts, 258
Surrealify an Image script, 137
Switch to Finder script, 7
System Events, 239
      classes, 240
      commands, 240

T[ Top ]
tell application command, 47
Tell Blocks command (Script Editor), 28
tell statements, 43
Terminal program, 252-256
      changing system settings, 253
      running AppleScript commands from, 261
      Unix without, 256-257
Test Interface command (Interface Builder), 290
testing and debugging scripts, 265-280
      compiling, 265
      error command, 275
      error prevention, 271
      errors, isolating and handling, 273
      Event Log, 267
      Event Log History, 269
      event notification, 266
      try statement, 273
      Xcode debugger, 275-280
text
      manipulating, 53-74
            concatenation, 56
            escape sequences, 58
            TextEdit, 59-66
      returned from dialog boxes, 54
      running scripts from, 72
Text Editing command (Xcode), 278
text item delimiters, 120
Text Suite, 65
      script example, 65
TextEdit
      adapting scripts, 67
      saving in, 102
      Services menu, 72
      Text Suite, 65
TextEdit scripting, 59-66
toolbar, 22-26
top program (Unix), 256
Trim File/Folder Names script, 8
try statement
      multiple commands in, 274
twirl filter (Photoshop), 135
typing function keys, 250

U[ Top ]
UI Element Scripts, 13, 250
UI scripts, 13
UIElementInspector tool, 247
UIElementInspector tool Web site, 245
Universal Access command, 239, 244
universal commands, 237
Unix
      AppleScript and, 251-264
      cron program, 261
      running AppleScripts from, 259
      scheduling AppleScript commands, 261
      superuser commands, 258
      system settings, 253
      text editing, 254
      without Terminal, 256-257
upload command, 197
uptime command, 253
uptime Unix program, 251
URL Access Scripting, 195-199
URL scripts, 13
URLs submenu, 13
Utilities folder, 109
Utilities folder command, 12

V[ Top ]
variables, 307
      string notation and, 54
      uses in scripts, 56
VersionTracker Web site, 295
ViaVoice, 162
View Source command, 177
Visual Basic
      macros, 74
      running from AppleScript, 74
Visual Basic, scripts and, 74
volume-up key, 95

W[ Top ]
WAV audio file format, 153
Web services scripts, 200
Web services, making AppleScript work with, 200
Web sites
      AE Monitor, 44
      Apple Human Interface Guidelines (HIG), 285
      Apple online retail shop, 13
      AppleScript, 6
      AppleScript Studio, 294
      Audible, 159
      Backup 2.0, 92
      Carbon Copy Cloner, 92
      error statement tricks, 274
      folder actions scripts, 235
      iLife, 126
      Keyboard Maestro, 157
      Late Night JavaScript, 44
      Mac Update, 295
      OmniWeb, 302
      PreFab UI Browser, 247
      random numbers, 130
      Retrospect Desktop, 91
      Smile editor, 38
      speech recognition, 163
      UIElementInspector tool, 245
      Versiontracker, 295
Where is iCa? compiler error, 266
windows
      moving, 84
      working with multiple, 83
wireless base station, 172
Word (see Microsoft Word)
Word Count command, 67, 68
word counting, 64
word processors, 302

X[ Top ]
Xcode, 38, 275-280
      Build and Debug command, 279
      Build and Run command, 279, 284, 294
      creating new project, 276
      New Project command, 276
      stepping through code, 279
      Text Editing command, 278
XML-RPC scripts, 200

Z[ Top ]
zooming in and out, 249

	

Zurück zu AppleScript: The Missing Manual


Themen

Buchreihen

Special Interest

International Sites

O'Reilly China O'Reilly France O'Reilly USA O'Reilly Japan O'Reilly Taiwan