PDA

View Full Version : Simple Programming on the Mac




SouthernAtHeart
Jan 5, 2012, 01:10 PM
I'm not schooled in programming, but self taught enough that I could write some VBA code in Outlook or MS Access to do things like import contacts from Outlook into Access and create a gpx file for GPS devices. Also I wrote little snippets like adding a button to outlook's toolbar that would add the current contact to a specified category. And numerous things in MS Word.
Now switching to Mac, I'm mainly interested in if it's possible to do this type of thing in Pages. I'm really not interested in Office for Mac, though I see it has VBA. I'd like to get away from Microsoft.
It'd be nice to be able to write little code and macros, though.
Is this something possible without a huge amount of training in programming? I've done quite a bit of programming the Arduino, but that's my extent of C.
Thanks for any suggestions.



mduser63
Jan 5, 2012, 02:22 PM
If the kind of programming you'd like to do is like the stuff you've already done, you should probably look at AppleScript. Many apps, both Apple apps and third-party apps, support it, and you can use it to automate all kinds of tasks on a Mac. If you're interested in learning to write full-fledged applications, you should learn Objective-C and Cocoa.

SouthernAtHeart
Jan 5, 2012, 02:44 PM
If the kind of programming you'd like to do is like the stuff you've already done, you should probably look at AppleScript. Many apps, both Apple apps and third-party apps, support it, and you can use it to automate all kinds of tasks on a Mac. If you're interested in learning to write full-fledged applications, you should learn Objective-C and Cocoa.

...no, not full fledged app, just little utilities to automate stuff. I found word on Objective C and Cocoa, which looks way over my head. But this AppleScript sounds like just what I might need! I'll check it out. Thanks.

firewood
Jan 5, 2012, 05:03 PM
There's AppleScript for working with Apple's application.

If you've used VBA, you might look into one of the simple Basic interpreters for the Mac do some really basic scripting without having to learn much of any new stuff.

But Python on the Mac is likely to be both easy enough and more useful.

balamw
Jan 5, 2012, 05:12 PM
...no, not full fledged app, just little utilities to automate stuff.

Note that OS X also comes with Automator (http://en.wikipedia.org/wiki/Automator_(software)) which can handle a lot of the kind of stuff you are talking about.

IMHO a key difference between Windows and OS X is in the system wide availability of tools like this. While VBA is embedded in certain apps, AppleScript and Automator act pretty uniformly everywhere. On Windows it always seems that the default is scripting off. (Yes. I know about WSH (http://msdn.microsoft.com/en-us/library/9bbdkx3k.asp) and VBScript)

B

thundersteele
Jan 5, 2012, 05:22 PM
Check Apple script and automator, as suggested above.

You should take a look at Pages, but you might be in for a disappointment. MS Office seems to be more mature and powerful at this point, also because Apple's office suite is now three years without major update.

I'm using keynote, which is much better than older powerpoint versions - however PP 2011 seems to be significantly improved. I never really got into Pages, it never felt as easy to use as openoffice or the old word versions I'm used to. With Exel vs. Numbers I don't have any experience.

KnightWRX
Jan 5, 2012, 05:46 PM
(Yes. I know about WSH (http://msdn.microsoft.com/en-us/library/9bbdkx3k.asp) and VBScript)

Old school. Up to date people talk about Power Shell (http://en.wikipedia.org/wiki/Windows_PowerShell). ;)

Side note, I always preferred installing ActiveState's Perl distribution, which integrated PerlScript into the WSH. Microsoft always ship only the lamoid VBScript and JScript engines. Also enabled PerlScript as a valid ASP language in IIS, which was pretty nice in and of itself.

balamw
Jan 5, 2012, 07:28 PM
Old school. Up to date people talk about Power Shell (http://en.wikipedia.org/wiki/Windows_PowerShell). ;)

I should have added "or whatever they call it today." ;) it's still VBScript and JScript and never enable on the machine I need it on. :p (EDIT: I take that back I didn't realize that PowerShell allowed for any .NET language, including C#. I'll have to play with that.).

ActiveState Perl is also on all my personal Windows installs, but I stay as far away from IIS as possible.

B

KnightWRX
Jan 5, 2012, 07:44 PM
ActiveState Perl is also on all my personal Windows installs, but I stay as far away from IIS as possible.

So do I, but I was forced once to write an ASP application (what a pain. Session this, Application that).

Mark FX
Jan 6, 2012, 01:38 PM
I would also advise you learn some Applescript as well, get to grips with it in
Applescript Editor.
When you've learned Vanilla Applescript, you could then think of moving
on to ApplescriptObjC which can also be written in the Lion version of
Applescript Editor, or Xcode, ApplescriptObjC is an extension to the Applescript
language that enables you to build full UI applications, and and uses the same
Cocoa Frameworks as the ObjectiveC programmers use, but is much easier
to learn, but you have to learn the basic Applescript language first.

Regards Mark

SouthernAtHeart
Jan 7, 2012, 02:05 PM
thanks, working on learning applecscript, now