Results 1 to 8 of 8

Thread: Using Cocoa API in VBA

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    268
    Location
    Hi kei,

    I'm not aware of any exact equivalents. But like shades says, you can access AppleScript through Office. This may or may not get you what you need, but will allow you to access Finder, other applications whether they are open or not.

    You can run an AppleScript from VBA using

    result
     = MacScript(script as string)
    where script can be either a script name (allegedly as I have not tried it), or the script itself contained in a string. Multiline scripts are put together using carriage returns, i.e.

    script = "line 1" & Chr(13) & "line 2"
    Also, you can run Office or Office VBA from AppleScript, so it goes both ways.

    If you've never looked at AppleScript, fish around in the Applications/AppleScript folder. If you open the Script Editor and select Open Dictionary from the menus, you can get a quick idea of what can be accessed, whether it's the Finder, Word, Safari, iTunes or whatever. Also, if you have a recent OS X install disk, I think there might be additional stuff buried in the developer tools. Happy hunting!
    Last edited by Aussiebear; 02-26-2025 at 03:21 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •