AutoHotkey Community

It is currently May 27th, 2012, 4:09 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: January 26th, 2006, 9:59 am 
Offline

Joined: January 24th, 2006, 6:04 am
Posts: 10
Location: Florida
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!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2006, 11:15 am 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
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
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2006, 11:24 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
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>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2006, 6:49 am 
Offline

Joined: January 24th, 2006, 6:04 am
Posts: 10
Location: Florida
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 27th, 2006, 3:32 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Leef_me, patgenn123, rbrtryn and 67 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group