Sign in to follow this  
Followers 0
fisofo

arrays and colored strings

11 posts in this topic

Okay, so I currently have a script that does the following:

1. grab a bunch of data from a table in a website (using the IE UDF)

2. write it into excel using an excel UDF that is in dev.

3. remove columns, apply sorting, and color cells based on value

4. copy said information and paste it into a "stickies" app that i use.

Now the script works just fine, but i'd like to bypass excel. I can sort and do everything just fine, except for the coloring/underlining/fontifying. Can I write a string to an array with format info so that I can then use *send* or something similar to put it directly into my final app? it would be nice to not have excel popping up and doing all that junk... and i'd bet it would be a lot faster too.

thanks for the help!

Share this post


Link to post
Share on other sites



Okay, so I currently have a script that does the following:

1. grab a bunch of data from a table in a website (using the IE UDF)

2. write it into excel using an excel UDF that is in dev.

3. remove columns, apply sorting, and color cells based on value

4. copy said information and paste it into a "stickies" app that i use.

Now the script works just fine, but i'd like to bypass excel. I can sort and do everything just fine, except for the coloring/underlining/fontifying. Can I write a string to an array with format info so that I can then use *send* or something similar to put it directly into my final app? it would be nice to not have excel popping up and doing all that junk... and i'd bet it would be a lot faster too.

thanks for the help!

can you supply a sample of the kind of information that your final app accepts?


[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]

Share this post


Link to post
Share on other sites

can you supply a sample of the kind of information that your final app accepts?

Well... not really, only because my last step in the app is an "_ExcelCopy" of the cells I want, and then a Send("^v") to the stickies app. So it's just a copy/paste operation.

I don't know much about AutoIt gui's, perhaps my answer lies there? Or is there a way i can get more information about the text i'm copying?

thanks for the response!

Share this post


Link to post
Share on other sites

Well... not really, only because my last step in the app is an "_ExcelCopy" of the cells I want, and then a Send("^v") to the stickies app. So it's just a copy/paste operation.

I don't know much about AutoIt gui's, perhaps my answer lies there? Or is there a way i can get more information about the text i'm copying?

thanks for the response!

Don't think anyone can help you with possibly formatting the string for the "stickies app" without knowing what the "stickies app" is.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Don't think anyone can help you with possibly formatting the string for the "stickies app" without knowing what the "stickies app" is.

heh... right :whistle:

Well, I'll see if there's more i can find out, I was just kinda thinking that there might be a way to format text in an array... but now that you mention it, i suppose it makes sense that it would be completely dependant on the destination.

If anyone else has a an idea, i'd like to hear it... otherwise it's "back to the drawing board"

Share this post


Link to post
Share on other sites

Well, you mentioned not wanting to have Excel "pop up." You can call _ExcelBookNew() like this to hide the Excel window:

$oExcel = _ExcelBookNew(0)

That will speed things up a little, as well. The Excel stuff will happen invisibly, in the background.

It's not the solution you're looking for, but it's "prettier" than watching an Excel window crunch a bunch of data.

-S


(Yet Another) ExcelCOM UDF"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly...[indent]...specialization is for insects." - R. A. Heinlein[/indent]

Share this post


Link to post
Share on other sites

Well, you mentioned not wanting to have Excel "pop up." You can call _ExcelBookNew() like this to hide the Excel window:

$oExcel = _ExcelBookNew(0)

That will speed things up a little, as well. The Excel stuff will happen invisibly, in the background.

It's not the solution you're looking for, but it's "prettier" than watching an Excel window crunch a bunch of data.

-S

not a bad idea... and i do like your excel functions. I'll try that as well, although I think I'm going to look into creating a gui instead of putting the stuff in a sticky. Should be interesting as i know nothing about the gui's yet :whistle:

Share this post


Link to post
Share on other sites

from what i can understand from your post, you get info from a website and copy it into excel only to extract it again... I suppose you do this to sort the data into tabular form. Why not just skip the whole excel step? Copy the info into an array, sort, concatenate, do whatever you need to do and directly input it into your 'sticky' app?


[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]

Share this post


Link to post
Share on other sites

from what i can understand from your post, you get info from a website and copy it into excel only to extract it again... I suppose you do this to sort the data into tabular form. Why not just skip the whole excel step? Copy the info into an array, sort, concatenate, do whatever you need to do and directly input it into your 'sticky' app?

Bingo! That's what I want to do. The problem I was having was that I couldn't figure out how to format the text as it is placed into the sticky app (it's this, btw: http://www.zhornsoftware.co.uk/stickies/). Whereas if i do a simple copy/paste from excel to the app, then formatting just comes along with it by default. Hence the question: can i format text that is stored in an array?

Anyway, now i'm thinking of just creating my own sticky by making a customized gui. Perhaps doing this would allow me to have realtime functionality (sort by clicking a button), although i'm not sure yet how to make rows and columsn and whatnot :whistle:

we'll see...

Share this post


Link to post
Share on other sites

Whereas if i do a simple copy/paste from excel to the app, then formatting just comes along with it by default. Hence the question: can i format text that is stored in an array?

Not in the array itself - it would be just a series of text strings. When you paste it into your application (in this case, Stickies), you'd still have to apply formatting in whatever way that application applies it. For example, if the key combination CTRL-U is used to underline text in your Stickie application, you'd have to send that key combo to Stickie for each item in your array you want underlined, once the data is copied in. That's an oversimplified example, but you get the idea.

Excel formatting works because the Stickie application is smart enough to deal with the formatting codes the clipboard received as part of the Excel copy procedure. Windows clipboard handles RTF and HTML (among others) and will paste the data in context depending on what the receiving application supports.

Notepad, for example, will receive clipboard contents stripped of any RTF formatting when receiving a paste, because it doesn't support RTF.

Anyway, now i'm thinking of just creating my own sticky by making a customized gui. Perhaps doing this would allow me to have realtime functionality (sort by clicking a button), although i'm not sure yet how to make rows and columsn and whatnot :whistle:

I think this is the best possible solution for getting data to format, display, and operate exactly how you want it. It's also the most time consuming. ;)

But hey, the experience gained is priceless, right?

-S


(Yet Another) ExcelCOM UDF"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly...[indent]...specialization is for insects." - R. A. Heinlein[/indent]

Share this post


Link to post
Share on other sites

I think this is the best possible solution for getting data to format, display, and operate exactly how you want it. It's also the most time consuming. :P

But hey, the experience gained is priceless, right?

-S

Time for some fun :whistle: Yep, that all makes sense, thanks for clearing things up guys! I'm sure i'll be starting another thread in the near future with questions on gui's ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0