It's month end and you need to fill in your time sheets but the time reporting system speaks in week numbers. Well fear not ... using your developer super powers you can use the humble date command and Apple Script to put a GUI on it (tm). In fact there are a whole host of OS X commands you can use to increase your developer super powers. Can you feel the energy...
Back to the OS X Command Line. To get the Week number use the date command:
date +%W
The +%W argument indicates format the current date as a Week Number.
Add the GUI using Apple Script you execute the date using the shell as follows:
set output to do shell script "date +%W"
Next Display a dialogue box with the output obtained from the
Darwin bash shell easy use following:
display dialog prompt with title "Week Number" buttons {"OK"} default button 1
Where the prompt is a concatenation of the description and shell output text.
set prompt to "Current Week Number : " & output as text
Now as you can see the OS X utilities are endless...
Use OS X Commands in AppleScript Today
Labels: Use OS X Commands in AppleScript TodayPosted by devnull at 20:58
Subscribe to:
Post Comments (Atom)
Design and icons by N.Design Studio | A Blogger Template by Blog and Web
Apple, the Apple logo, iTunes, Cocoa, GarageBand, Mac OS, Xcode and Mac are trademarks of Apple Computer, Inc., registered in the U.S. and other countries. OpenGL is a registered trademark of SGI.Unix® is a trademark of the Open Group. BSD is a registered trademark of UUnet Technologies, Inc.

Blog related articles and applications by devnill is licensed under a Creative Commons Attribution 2.0 UK: England & Wales License.
Based on a work at macateeny.blogspot.com.
Permissions beyond the scope of this license may be available at macateeny.blogspot.com.
0 comments:
Post a Comment