AutoHotkey Community

It is currently May 27th, 2012, 12:29 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: December 11th, 2009, 1:46 am 
Offline

Joined: December 6th, 2007, 12:48 pm
Posts: 364
Hi ahk experts!
Let me bring you a simple "challenge":
Lets say I have a exactly the following on my clipboard:

Code:
C:\file 10-12.txt
C:\file 7-12.txt
C:\file 8-12.txt
C:\file 9-12.txt


The fact that all file paths are in different lines is relevant. But there isn't a command that can read lines from the clipboard content, like FileReadLine does with text files. The idea is to transpose the clipboard data to a text file so the lines can be read in sequence.

But using FileAppend will not make that possible unless there is a way to have the above become:
Code:
C:\file 10-12.txt`nC:\file 7-12.txt`nC:\file 8-12.txt`nC:\file 9-12.txt

...automatically.

What can I do in this case?

thanks for any help.

_________________
AHK is perfect.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2009, 1:53 am 
Code:
data = %clipboard%
Loop, parse, data, `n, `r
{
    MsgBox, 4, , Line number %A_Index% is %A_LoopField%.`n`nContinue?
    IfMsgBox, No, break
}

?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2009, 8:02 am 
Offline

Joined: December 6th, 2007, 12:48 pm
Posts: 364
Nice! this makes it look so easy! But the fact is that I didn't tell you where I'd apply that. That is to make faster the e-mail attachments in Thunderbird. I had to send to a mate four text files at the very end of the class, when none of us had time to wait. Since I was using the notebook, the trackpad makes it even nastier.

What I was thinking:
1- Put the clipboard content (which I got from xplorer², a fantastic Windows Explorer replacement by hitting Alt+C, a built-in function that copies the file(s) path(s) to the clipboard) in a text file;
2- Activate the Thunderbird window, have ahk send "!axa" to open the attachments dialog;
3- Fill in the contents of the above text file's line 1, which is the path to the first file
4- Hit enter to attach
5- Repeat this until all are attached.

OR

Take that file list, and use winrar's command line functions to quickly zip them and attach in the Thunderbird message, which could be even more complicated.

But I think both ideas above are complicated and not so well reliable.

What would you suggest me to accomplish this? :)

_________________
AHK is perfect.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2009, 8:45 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
Look at the various script to automate email, why reinvent the wheel? Personally I'd use blat but you can use http://www.autohotkey.com/forum/viewtop ... light=blat for example

That way all is done by ahk and relies on programs running and sending key strokes.

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2009, 8:03 pm 
Offline

Joined: December 6th, 2007, 12:48 pm
Posts: 364
Because this would not be only about sending e-mails, but this routine can be applied to many things. Yesterday, when I was thinking about a way to do it, I realised, for example, that this can be done to send attachments in an e-mail and also make it use the rar/unrar functions of winrar more quickly. That's why I need a way to have the cliboard content to interact with a text file plus the fileappend and fileread commands. ?)

_________________
AHK is perfect.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 11th, 2009, 9:08 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
I assume - I don't use rar as it is for nerds only :-) - rar can read a filelist from a file (zip can, so rar can to I think), so can ahk. Thus solution is simple: save clipboard to file and do with it what you want: pass on the filelist.txt to rar via cmdline parameter to rar (or zip) files. Launch ahk script to that reads filelist and does something with it like emailing via blat or ahk method. Save clipboard to file :!:

Edit: Total Commander is far superior in my opinion :wink:

Edit2: You do realise you can save the clipboard with fileappend don't you?
Code:
FileAppend, %clipboard%, filelist.txt
Otherwise I don't understand the question actually

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2010, 1:22 am 
Offline

Joined: December 6th, 2007, 12:48 pm
Posts: 364
Wow its been quite a long time since I started this thread!

Now I'd like to ask you two things hugoV:

1 - The thing I want has not gone cold but I was reading your previous post about e-mail via command line and I got interested. Perhaps this is more important now: I Googled about Blat and found it. Such a tiny application! I appeared to be simple and functional, but, when trying to configure a gmail account to send via smtp, using some info from the documentation and some of the echoes from the program itself, I saw one error after another. Got very sad and don't know what to do. Assuming I have setup a fresh new Gmail account, what to do next?

2 - Whats so special about total commander? I like xplorer² because it is simple, besides powerful, and has the very nice and necessary rectangle selection! Or does TC have it too?

p.s. Mods, if this has gone so offtopic it's beyond the forum rules, please let me know so I can open this in another area in this forum. :)

_________________
AHK is perfect.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2010, 9:19 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
Google for blat gmail and a few pages will turn up I'm sure, here is one that might get you started http://www.lifehacker.com/software/emai ... 168156.php so I assume something like Blat -install smtp.google.com your-funny-account-at@gmail.com typed at the command line prompt (dos box) to begin with. (Search the forum for blat as well)

Re: TC what is not to like? It has the familiar two panel interface which might take a bit of getting used to but you can customize it there are many many many plugins and hidden features, built in FTP, directory bookmarks for quick navigation (and you can use a script to read those bookmarks and use them in your windows open/file dialogs) still runs on Win98, has tabs etc the list is endless. No sure what you mean by rectangular selection but you have many options to quickly sort and select specific file types with keyboard or mouse). It does have a learning curve so you would really have to use it for a few weeks before you get a hang of it, but once you master it nothing will beat it. But as always a filemanager is something of a personal preference so it might not be for you. You can try the TC shareware version for 30 days or so, but its well worth the money (lifetime free updates).

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, iDrug, Leef_me, Ohnitiel, rjgatito and 21 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