To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=71420
                 Issue #|71420
                 Summary|execute macros from applescript
               Component|porting
                 Version|current
                Platform|Macintosh
                     URL|
              OS/Version|Mac OS X
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|MacOSX
             Assigned to|ericb
             Reported by|michelr





------- Additional comments from [EMAIL PROTECTED] Fri Nov 10 06:52:45 -0800 
2006 -------
you need to modify the applescript located in 
"OpenOffice.app/Contents/Resources/Scripts/Main.spt" :
just add the following code :
---------------------------------------------
on macro(theMacro)
        if (preRun()) then
                openMacro(theMacro)
        end if
        
end macro

on openMacro(aMacro)
        set theDisplay to startXServer()
        if (theDisplay is equal to "error") then
                return
        end if
        set theEnv to "DISPLAY=" & theDisplay & " ; export DISPLAY; "
        set theCmd to "sh \"" & POSIX path of getOOProgramPath() & "soffice" & 
"\" "
        set theScript to theEnv & theCmd & " 'macro:///" & aMacro & "' " & "  
&>/dev/null & echo $!"
        -- display dialog theScript
        do shell script theScript
end openMacro
---------------------------------------------

That's all !

Now, we can call OpenOffice and ask it to execute a macro like this :

tell application "OpenOffice.org2.0"
        macro("Standard.Module1.myMacro(aParam)")
end tell


Note :
if you send a file's path, you need to write it the unix way, not the mac way :
- mac way :  "absolute:path:to:the:file"
- unix way : "/Volumes/absolute/path/to/the/file"

example of a call with a file as param :
tell application "OpenOffice.org2.0"
        macro("Standard.Module1.myConvert(/Volumes/absolute/path/to/the/file)")
end tell

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to