mIRC Home    About    Download    Register    News    Help

Print Thread
#267431 04/07/20 03:19 PM
Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
Hi, I'm hoping to write something that alert me for any new files/folders uploaded by someone onto my dropbox.

I plan to run this timer every 5 mins on mIRC startup

Code
alias FDD {
var %FDpath C:\Users\colt\Dropbox
  echo @NEW New Directory(s) Detected : $finddir(%FDpath,*.*,0,0,echo $1-)
  echo @NEW New File(s) Detected : $findfile(%FDpath,*.*,0,0,echo $1-)
}
The result isn't how I was hoping for, all I see the output was
Code
C:\Users\colt\Dropbox\Test
C:\Users\colt\Dropbox\test1.txt
C:\Users\colt\Dropbox\test2.txt
C:\Users\colt\Dropbox\test3.txt
but what I see in @NEW
Code
New Directory(s) Detected : 1
New File(s) Detected : 3
How can I get this to display them into @NEW window? So that it would show like this ...
Code
New Directory Detected : C:\Users\colt\Dropbox\Test
New File(s) Detected : C:\Users\colt\Dropbox\test1.txt
New File(s) Detected : C:\Users\colt\Dropbox\test2.txt
New File(s) Detected : C:\Users\colt\Dropbox\test3.txt


Hope someone can help me,

Thanks

Joined: Oct 2005
Posts: 34
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Oct 2005
Posts: 34
Hi, you can try this out which may serve your purpose

Quote
alias FDD {
var %FDpath C:\Users\colt\Dropbox
/window @NEW | echo @NEW New Directory(s) Detected : $finddir(%FDpath,*.*,0,)
/window @NEW | echo @NEW New File(s) Detected : $findfile(%FDpath,*,0,1)
}


Thanks

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
You've got 2 echoes going on, you're sending the count of matching folders to @new but the echo of the individual matches are going to the status window. If you want both to go to @new, then you need to send both echoes there. If you only want the matches going there, then do something like

//noop $finddir(%fdpath,*,0,1,echo @NEW New Directory(s) Detected : $1-)

Note that the depth of 0 you used behaves like depth of 1, so you're not seeing subdirs unless you either change depth to something big like 99 or just drop that 4th parm. Also note that if you're trying to copy/move folders or filenames someone creates having doublespaces would require special handling, such as addressing them using $shortfn.

Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
Originally Posted by SLiprockS
Hi, you can try this out which may serve your purpose

Quote
alias FDD {
var %FDpath C:\Users\colt\Dropbox
/window @NEW | echo @NEW New Directory(s) Detected : $finddir(%FDpath,*.*,0,)
/window @NEW | echo @NEW New File(s) Detected : $findfile(%FDpath,*,0,1)
}


Thanks


Thanks for getting back to me, however - it's not how I want to see .. I see this when I ran that.
Code
New Directory(s) Detected : 1
New File(s) Detected : 3

and nothing else, I just want to display the new filename and new directory .. not numbers smile
Preferably want to announce into a channel where I and my other friend can view of any new items coming in.

Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
Originally Posted by maroon
You've got 2 echoes going on, you're sending the count of matching folders to @new but the echo of the individual matches are going to the status window. If you want both to go to @new, then you need to send both echoes there. If you only want the matches going there, then do something like

//noop $finddir(%fdpath,*,0,1,echo @NEW New Directory(s) Detected : $1-)

Note that the depth of 0 you used behaves like depth of 1, so you're not seeing subdirs unless you either change depth to something big like 99 or just drop that 4th parm. Also note that if you're trying to copy/move folders or filenames someone creates having doublespaces would require special handling, such as addressing them using $shortfn.


That's the one! laugh
Works, now time for me to improvise!
Thanks smile


Link Copied to Clipboard