Re: [api-dev] Macro Questions

2008-07-05 Thread Andrew Douglas Pitonyak


Hal Vaughan wrote:

On Wednesday 02 July 2008, Andrew Douglas Pitonyak wrote:
  

I wondered if it was the same Hal :-)



Yes.  Originally my plans were to do an application completely in 
OOBasic, but that never worked out because I needed some functions that 
weren't available, such as reliable (and preferably encrypted) file 
transfer.  I ended up having to learn Java and writing my app in Java.  
It works fine and in the first 18 months that version 1.0 was running I 
had something like 4-5 bug reports, including cases like a client who 
had troubles because my program would write out files that were later 
unreadable by OOo, but it turned out it was because he had bad sectors 
on his drive.  (The files I created were okay -- just corrupted by a 
bad drive!)


I remember at the time I was working on a way to create macros that 
would go with the document and hoped to write that up, but it looks 
like there's a better setup now.


With this small project, I won't be doing anything complex.  It's to 
help me with writing screenplays.  I need 4 main macros that will 
change the margins to specific settings, one to ask me the script title 
and from there create a new directory in my writing directory for it 
and to put that title in the headers and title page.  

This next part may be off because it's been so long since I've been able 
to sit down and write in an actual word processor, so I don't remember 
if OOo uses the ALT key for any commands, but let's assume it doesn't 
for now.  I'll have one other main macro.  When I call it, it'll ask me 
for a phrase, which will usually be a character's name, then it'll ask 
me to press a key (or enter a key in a dialog box).  Then it'll create 
a macro (hopefully for that document only) that will, within that 
macro, call up one of the margin setting macros, then type the name (or 
phrase) I entered in the dialog box.  It'll also link that macro to the 
key I specified when used with the ALT key.


I had a system like that on Word Perfect that worked just fine for me.  
I'm lucky, I write my screenplays for me and for the film company I'll 
be starting soon.  I don't have to worry about many of the rules of 
screenplay formatting that get in the way and I prefer not to use 
programs designed for screenwriters -- I like doing all my writing in 
one program.  All I need to customize it is to be able to set up the 
macros I just mentioned.


I just wanted to get an idea of whether anyone know if it was possible 
to do the things I wasn't sure of before researching it.  If I got 
a "No," then I knew it wouldn't be worth the hours or days it could 
take to go through the API and experiment.


I can post the results when I'm done, if it'll help.

Hal
Remember, never do more work than you need to make You may be able 
to use auto formatting to do the same thing. I have not used it I 
thought that you could set formatting and everything. The idea would be 
something like this:


You enter some specific text.
Press a key like Ctrl+F3
Based on the text that is present, new text and/or formatting is applied

I need to search around OOo a bit to figure it out, but it might be one 
of these. (and I need to be somewhere soon so I can not look now).


http://wiki.services.openoffice.org/wiki/Documentation/OOoAuthors_User_Manual/Writer_Guide/Using_AutoText
http://wiki.services.openoffice.org/wiki/Documentation/OOoAuthors_User_Manual/Writer_Guide/Autoformatting

The bottom line is that you would simply need to create the entry and 
then use it. This might be easier than the macro, perhaps not...


--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


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



Re: [api-dev] Macro Questions

2008-07-05 Thread Hal Vaughan
On Saturday 05 July 2008, Andrew Douglas Pitonyak wrote:
> Hal Vaughan wrote:
...
> > This next part may be off because it's been so long since I've been
> > able to sit down and write in an actual word processor, so I don't
> > remember if OOo uses the ALT key for any commands, but let's assume
> > it doesn't for now.  I'll have one other main macro.  When I call
> > it, it'll ask me for a phrase, which will usually be a character's
> > name, then it'll ask me to press a key (or enter a key in a dialog
> > box).  Then it'll create a macro (hopefully for that document only)
> > that will, within that macro, call up one of the margin setting
> > macros, then type the name (or phrase) I entered in the dialog box.
> >  It'll also link that macro to the key I specified when used with
> > the ALT key.
...
> >
> > Hal
>
> Remember, never do more work than you need to make You may be
> able to use auto formatting to do the same thing. I have not used
> it I thought that you could set formatting and everything. The
> idea would be something like this:
>
> You enter some specific text.
> Press a key like Ctrl+F3
> Based on the text that is present, new text and/or formatting is
> applied
>
> I need to search around OOo a bit to figure it out, but it might be
> one of these. (and I need to be somewhere soon so I can not look
> now).
>
> http://wiki.services.openoffice.org/wiki/Documentation/OOoAuthors_Use
>r_Manual/Writer_Guide/Using_AutoText
> http://wiki.services.openoffice.org/wiki/Documentation/OOoAuthors_Use
>r_Manual/Writer_Guide/Autoformatting
>
> The bottom line is that you would simply need to create the entry and
> then use it. This might be easier than the macro, perhaps not...

I have to look into it, but the advantage of a macro is that once I 
specify the macro, it happens in one keystroke every time.  It sounds 
like this means I'd type the full text, THEN specify the formatting.  
The idea is that even though all I'm typing is names, I can still set 
the margins and type the name in one stroke.  This other way I'd have 
to type the name, then hit the keys for formatting.

I have wondered about using an F key instead of a key combination.  For 
example, there are some F keys that aren't used.  I thought at one 
point I had found a way to make OOo listen after a keypress.  In other 
words, I could type something like, say, F6 and it might trigger a 
macro that does nothing but listen for the next key until it gets a 
keypress.  Then when it does, it dispatches the control to the 
appropriate macro.

Just for reference, a script looks a bit like this:
-
FADE IN:


EXT.  PARKER'S MOUNTAIN SHACK

Sunrise coming over the mountains and lighting up the roof of the shack 
as we see PARKER emerge from the door, stretching in the morning.

  PARKER
   (as he stretches and yawns)
   Ho, hum.  Another boring day on the island of
   Pagay Pagay...
-

I don't know how that came across in your email, with font changes, but 
there are 4 distinct margins, the one for the first 4 typed lines, the 
one for the character's name when he speaks (which many systems just 
center, other times people use a set margin for it), then one for stage 
directions (the next line) and a 4th for what people say.

In a script you often have a lot of dialog, which means typing people's 
names at that place in the center of the page or with that widest 
margin 20 times or so in a page.  That's why being able to just hit a 
key instead of typing their full name is so handy.  And with that many 
margin changes, you can see why changing a paragraph margin with a 
single keystroke is not a luxury but a must.

When I was on the Amiga, it was a nightmare dealing with some companies 
and their word processors.  Except for Word Perfect, not one word 
processor let you change the margin through keystrokes, you had to use 
the mouse, and trying to do that when writing a script with the 
frequent margin changes you've just seen is simply not possible if you 
want to have an average typing speed that's faster than a 5 year old 
hunting-and-pecking.

When I first started checking out OOo, I was concerned because OOo 
doesn't do actual margin changes without forcing a page break (a 
serious flaw, as I see it), so when I did early imports from Word 
Perfect, I'd get one line per page in many cases and it's only after 
the filter was created to import Word Perfect documents that the 
situation changed.

Anyway, I thought by giving an example of a script page, it would help 
make more sense of what I'm trying to do.


Hal

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



Re: [api-dev] Macro Questions

2008-07-05 Thread Andrew Douglas Pitonyak

Hal Vaughan wrote:

On Saturday 05 July 2008, Andrew Douglas Pitonyak wrote:
  

Hal Vaughan wrote:


...
  

You enter some specific text.
Press a key like Ctrl+F3
Based on the text that is present, new text and/or formatting is
applied

I need to search around OOo a bit to figure it out, but it might be
one of these. (and I need to be somewhere soon so I can not look
now).

http://wiki.services.openoffice.org/wiki/Documentation/OOoAuthors_Use
r_Manual/Writer_Guide/Using_AutoText
http://wiki.services.openoffice.org/wiki/Documentation/OOoAuthors_Use
r_Manual/Writer_Guide/Autoformatting

The bottom line is that you would simply need to create the entry and
then use it. This might be easier than the macro, perhaps not...



I have to look into it, but the advantage of a macro is that once I 
specify the macro, it happens in one keystroke every time.  It sounds 
like this means I'd type the full text, THEN specify the formatting.  
The idea is that even though all I'm typing is names, I can still set 
the margins and type the name in one stroke.  This other way I'd have 
to type the name, then hit the keys for formatting.


I have wondered about using an F key instead of a key combination.  For 
example, there are some F keys that aren't used.  I thought at one 
point I had found a way to make OOo listen after a keypress.  In other 
words, I could type something like, say, F6 and it might trigger a 
macro that does nothing but listen for the next key until it gets a 
keypress.  Then when it does, it dispatches the control to the 
appropriate macro.
  

No, if it works, it would look more like this:

You enter the text park and press Ctrl+F3, or something similar, and 
then it replaces Park with something, and formats it. Certainly, this 
can be done in a macro, but if the auto-formatting stuff can also do 
this, then, well, it would be easier :-)




In a script you often have a lot of dialog, which means typing people's 
names at that place in the center of the page or with that widest 
margin 20 times or so in a page.


I considered this with respect to scripts for puppets. I considered 
storing names in fields so that I could instantly change a name 
everywhere at one time.



When I first started checking out OOo, I was concerned because OOo 
doesn't do actual margin changes without forcing a page break (a 
serious flaw, as I see it), so when I did early imports from Word 
Perfect, I'd get one line per page in many cases and it's only after 
the filter was created to import Word Perfect documents that the 
situation changed.
  

I still think that you should use paragraph styles.

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


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