• MacTech Network:
  • Tech Support
  • |
  • MacForge.net
  • |
  • Apple News
  • |
  • Register Domains
  • |
  • SSL Certificates
  • |
  • iPod Deals
  • |
  • Mac Deals
  • |
  • Mac Book Shelf

MAC TECH

  • Home
  • Magazine
    • About MacTech in Print
    • Issue Table of Contents
    • Subscribe
    • Risk Free Sample
    • Back Issues
    • MacTech DVD
  • Archives
    • MacTech Print Archives
    • MacMod
    • MacTutor
    • FrameWorks
    • develop
  • Forums
  • News
    • MacTech News
    • MacTech Blog
    • MacTech Reviews and KoolTools
    • Whitepapers, Screencasts, Videos and Books
    • News Scanner
    • Rumors Scanner
    • Documentation Scanner
    • Submit News or PR
    • MacTech News List
  • Store
  • Apple Expo
    • by Category
    • by Company
    • by Product
  • Job Board
  • Editorial
    • Submit News or PR
    • Writer's Kit
    • Editorial Staff
    • Editorial Calendar
  • Advertising
    • Benefits of MacTech
    • Mechanicals and Submission
    • Dates and Deadlines
    • Submit Apple Expo Entry
  • User
    • Register for Ongoing Raffles
    • Register new user
    • Edit User Settings
    • Logout
  • Contact
    • Customer Service
    • Webmaster Feedback
    • Submit News or PR
    • Suggest an article
  • Connect Tools
    • MacTech Live Podcast
    • RSS Feeds
    • Twitter

Moving from Microsoft Office VBA to AppleScript:
MacTech's Guide to Making the Transition

Introduction  |  Table of Contents

Page Prev and Page Next buttons at bottom of the page.

Would you like a hard copy
or PDF of this Guide?

You can get a hard copy sent to you
AND download a PDF now ($19.95)
, or

... just download a PDF ($9.95).

Either way, you get a complimentary
MacTech Magazine Subscription

courtesy of the
Microsoft Mac Business Unit


 

  Magazine Reg. Price:  $50.00 value  
  Guide Reg. Price:  $40.00 value  
  You Save:  over $80.00!  

April, 2007
Page 6



Unlike Entourage, which has had its own script menu from its inception, Word, Excel and PowerPoint 2004 do not have their own script menus. (It‘s always possible that the next version might introduce these, which would allow for keyboard shortcuts such as Entourage does.)

But the OS has its own script menu. To enable it, in Tiger OS 10.4 go to /Applications/AppleScript/AppleScript Utility and double-click it. Click "Show scripts menu in menu bar" checkbox and close. (In Panther OS 10.3, go to /Applications/AppleScript/Script Menu.menu and double-click it.) Now you will see a black "squiggly-S" icon on the right-hand side of the main menu bar, near the menu clock:

^ System Script Menu

Click the menu, then Open Scripts Folder/Open User Scripts Folder (in Panther, there is no sub-item). This creates and opens a "Scripts" folder here: ~/Library/Scripts/, where ~/ means your username Home folder (Mac HD/Users/username/). This is where you will store your scripts to make them appear in the same menu – you just select a script name in the menu and it runs.

If the menu starts to get too long for comfort, and you‘d like to see some or all of your Word scripts, say, only when Word is in the front, make an "Applications" subfolder inside this Scripts folder, and then a "Microsoft Word" (and a separate "Microsoft Excel" and "Microsoft PowerPoint" and whichever other applications you‘d like to do the same for) subfolder inside the "Applications" folder. You must spell out the full name of the application exactly as it appears on your computer or it won‘t make the match to the application. You can do all this automatically in OS 10.4 (and later, presumably) by bring Word or any application to the front, clicking the Script menu, and choose Open Scripts Folder/Open Microsoft Word Scripts Folder: this creates the folder if it does not yet exist. Now any scripts saved in the Microsoft Word subfolder will be seen in the Scripts menu only when Word is the active application in the front. (So don‘t put scripts in there that you want to call from another application or the Finder to get Word going.)

This is one great advantage AppleScript has over VBA: You can call a Word script from, say, Entourage or FileMaker Pro, to take some selected text, for example, and use it in a Word document, perhaps even doing it all automatically in the background. It is certainly a limitation that you cannot call scripts from a button on a Word toolbar nor (yet) from a keyboard shortcut (at least not without a third-party utility such as iKey, DragThing or QuicKeys: see the Resources chapter for URLs), but the Scripts menu is nevertheless and excellent device for running scripts with no overhead. In the next chapter I discuss some third-party tools that can provide palettes with buttons for running scripts, and even toolbars you can make yourself if you are up to it.



< Previous Page Next Page>
 
MacTech Only Search:
Community Search:

 
 
 

 
 
 
 
 
  • SPREAD THE WORD:
  • Slashdot
  • Digg
  • Del.icio.us
  • Reddit
  • Newsvine
  • Generate a short URL for this page:



MacTech Magazine. www.mactech.com
Toll Free 877-MACTECH, Outside US/Canada: 805-494-9797
MacTech is a registered trademark of Xplain Corporation. Xplain, "The journal of Apple technology", Apple Expo, Explain It, MacDev, MacDev-1, THINK Reference, NetProfessional, Apple Expo, MacTech Central, MacTech Domains, MacNews, MacForge, and the MacTutorMan are trademarks or service marks of Xplain Corporation. Sprocket is a registered trademark of eSprocket Corporation. Other trademarks and copyrights appearing in this printing or software remain the property of their respective holders.
All contents are Copyright 1984-2010 by Xplain Corporation. All rights reserved. Theme designed by Icreon.
 
Nov. 20: Take Control of Syncing Data in Sow Leopard' released
Nov. 19: Cocktail 4.5 (Leopard Edition) released
Nov. 19: macProVideo offers new Cubase tutorials
Nov. 18: S Stardom anounces Safe Capsule, a companion piece for Apple's
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live
Nov. 17: Ableton releases Max for Live