AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Possible to paste text in multiple fonts?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
jagpanzer



Joined: 24 Jan 2006
Posts: 10
Location: Florida

PostPosted: Thu Jan 26, 2006 8:59 am    Post subject: Possible to paste text in multiple fonts? Reply with quote

Hi!

I'm new to autohotkey, but I'm loving it. I do a lot of production centered Flash animation, and in the last day or two I've managed to write AHK scripts that do large parts of the tedious work for me!! LOVE IT!!!

One thing I'm trying to do is have AHK paste bullets into text... no, not the killing kind of bullet, but this kind: •

Unfortunatly, the bullets I need to use are in a different font from the rest of the text I'm working with. Specifically, the main text is 'Arial', and the bullets come from 'WP Typographic Symbols'. (isn't upper management intelligent??) I re-use these bullets on a massive basis, so I'm basically trying to set up something so that I can paste/manipulate the damn things with the other functions I've written. Unfortunatly, I'm still pretty new to all of this, and it seems like text loses its formatting when its sent to the clipboard or across programs.

So, my question is -- is there some way I can use AHK to "hardcode" these bullets as a var (like bullet1 = •), while maintaining the font ?

O_o

Otherwise, any questions/input are valued. Thanks for your time!!
Back to top
View user's profile Send private message Visit poster's website
toralf



Joined: 31 Jan 2005
Posts: 3910
Location: Bremen, Germany

PostPosted: Thu Jan 26, 2006 10:15 am    Post subject: Reply with quote

you could try this:

if you can copy a bullet into the clipboard and paste it back somewhere in your document, and that works.
Then you may try to save the clipboard into a var with ClipBoardAll. So now you have a copy of the bullet in your code. Now if you hit a hotkey, you could put the var back into the clipboard and paste it into the text.
The are some limitations to ClipBoardAll, mostly known with pictures copy&paste in MS Word. But Please test.

You may save the var to disc. So that at startup of your script you can load it, and you do not have to put each day the bullet into a var.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
PhiLho



Joined: 27 Dec 2005
Posts: 6836
Location: France (near Paris)

PostPosted: Thu Jan 26, 2006 10:24 am    Post subject: Reply with quote

I give an example with Wordpad, you can probably adapt to your software:
Code:
F11::
SetTitleMatchMode 2
ifWinActive WordPad
{
   ControlGet currFont, Choice, , ComboBox1
   ControlFocus ComboBox1
   Control ChooseString, Wingdings, ComboBox1
   IfEqual ErrorLevel, 1, MsgBox Error!
   ControlFocus RichEdit50W1
   Send l
   ControlFocus ComboBox1
   Control ChooseString, %currFont%, ComboBox1
   ControlFocus RichEdit50W1
   Send %A_Space%
}
Return

Two additional remarks:
- Thanks Chris for helping to understand why I couldn't change the font.
- <OT>Can't we have a SetTitleMatchMode 4 to match strings on the right of the title? Most modern applications show Doc Name - AppName in the title, and mode 2 may be ambiguous, eg. if I have a text editor with a document named Switching font in Wordpad.txt... Or did I missed something again?</OT>
Back to top
View user's profile Send private message Visit poster's website
jagpanzer



Joined: 24 Jan 2006
Posts: 10
Location: Florida

PostPosted: Fri Jan 27, 2006 5:49 am    Post subject: Reply with quote

Sorry for the late reply, I put in a 10 hour day @ work, and then our internet went down.. blargh. Gotta get up in 5 hours so I can drive to Tampa and pick up my buddy who is flying back from his gov't contracting job in Maryland.... Whee...!

Anyway...

@ toralf: Setting the bullet to a var would be ideal, my scripts currently use the clipboard a fair amount (as well as clearing it) so I'm going to have to learn more before I figure out how to do it, though.

@ Philho: Thanks man, great example. It took a little playing to get it to work with Flash (the combobox# is dynamic depending on what panels you have open) but the idea is great and gave me the groundwork I needed to write a solid script. Props.
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Fri Jan 27, 2006 2:32 pm    Post subject: Reply with quote

PhiLho wrote:
Can't we have a SetTitleMatchMode 4 to match strings on the right of the title?
Given the other means of working around it (such as WinGet to get the ID or narrowing down the search via WinText or using multiple WinTitle critieria), I don't think it would be worth it. But further comments are welcome from anyone.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group