OOBasic Date Picker dialog

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
sajnoor
Posts: 21
Joined: Fri Nov 09, 2018 2:35 pm

OOBasic Date Picker dialog

Post by sajnoor »

hi

need help have installed calendar add on and it works fine when i press control + shift + F2 or tools then add on and choose calendar, after installing this add on from here https://sourceforge.net/projects/aoo-ex ... t/download
i have now installed date picker above i am new to macros how do i automate this macro so when i select row calendar appears or so add on installed appears with one key instead of 3 keys together.
many thanks in advance without you lot i would be lost

saj
 Edit: Split from a Code Snippets topic. That forum is not for help on the snippets provided. 
Openoffice 4.1.5, windows 7 64 bit
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: OOBasic Date Picker dialog

Post by Villeroy »

Code: Select all

srv = createUnoService("vnd.pycalendar")
srv.trigger("")
Works if the current frame has a document.
Fails when called from Basic IDE.
Fails with LibreOffice 6.1
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
sajnoor
Posts: 21
Joined: Fri Nov 09, 2018 2:35 pm

Re: OOBasic Date Picker dialog

Post by sajnoor »

Villeroy wrote:

Code: Select all

srv = createUnoService("vnd.pycalendar")
srv.trigger("")
Works if the current frame has a document.
Fails when called from Basic IDE.
Fails with LibreOffice 6.1
Was this for me ? :?
Openoffice 4.1.5, windows 7 64 bit
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: OOBasic Date Picker dialog

Post by Villeroy »

This is how you can call the dialog from StarBasic. You can save this as a StarBasic routine and call that routine with your own shortcut.
Otherwise, you may modify the file Accelerators.xcu of the add-on package:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data
 xmlns:oor="http://openoffice.org/2001/registry"
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
 xmlns:install="http://openoffice.org/2004/installation"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 oor:name="Accelerators"
 oor:package="org.openoffice.Office">
  <node oor:name="PrimaryKeys">
    <node oor:name="Modules">
      <node oor:name="com.sun.star.sheet.SpreadsheetDocument">
        <node oor:name="F2_MOD1_SHIFT" oor:op="fuse">
          <prop oor:name="Command">
            <value xml:lang="en-US">service:vnd.pycalendar?execute</value>
          </prop>
        </node>
      </node>
    </node>
  </node>
</oor:component-data>
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
sajnoor
Posts: 21
Joined: Fri Nov 09, 2018 2:35 pm

Re: OOBasic Date Picker dialog

Post by sajnoor »

Villeroy wrote:This is how you can call the dialog from StarBasic. You can save this as a StarBasic routine and call that routine with your own shortcut.
Otherwise, you may modify the file Accelerators.xcu of the add-on package:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data
 xmlns:oor="http://openoffice.org/2001/registry"
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
 xmlns:install="http://openoffice.org/2004/installation"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 oor:name="Accelerators"
 oor:package="org.openoffice.Office">
  <node oor:name="PrimaryKeys">
    <node oor:name="Modules">
      <node oor:name="com.sun.star.sheet.SpreadsheetDocument">
        <node oor:name="F2_MOD1_SHIFT" oor:op="fuse">
          <prop oor:name="Command">
            <value xml:lang="en-US">service:vnd.pycalendar?execute</value>
          </prop>
        </node>
      </node>
    </node>
  </node>
</oor:component-data>

:roll: :shock:
Where do i place this code ? or how do i modify accelerators.xcu new to spreadsheets so asking very basic questions for some of you on here
Openoffice 4.1.5, windows 7 64 bit
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: OOBasic Date Picker dialog

Post by Villeroy »

The downloaded pycalendar-3.4.3.oxt is a zip archive. Extract it, load Accelerators.xcu in a text editor, change the "F2_MOD1_SHIFT" entry, rebuild the archive and install it.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
sajnoor
Posts: 21
Joined: Fri Nov 09, 2018 2:35 pm

Re: OOBasic Date Picker dialog

Post by sajnoor »

Villeroy wrote:The downloaded pycalendar-3.4.3.oxt is a zip archive. Extract it, load Accelerators.xcu in a text editor, change the "F2_MOD1_SHIFT" entry, rebuild the archive and install it.
perfect assigned to f3 key works a treat many thanks :bravo: :bravo: :bravo:
Openoffice 4.1.5, windows 7 64 bit
Post Reply