Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please help: Replace selected file name with string
#1
Hi,

Please forgive my ignorance/newbish question. (I have tried hard to find an answer on my own...)

I was just about to break out the champagne (well, Guinness actually) on the completion of the first bit of my first real-application macro, but I can't get past one part.

Basically I'm using the stock/unmodified "BrowseForFolder" function to select a path/filename, returned as "s", to be renamed or copied with the string "zz" (derived from date+user-inputed text, re-formatted all lowercase and underscores replacing spaces).

ISSUES:
1. I get an error message saying "this destination does not support long file names" (see attached jpg) and asks me for a new name (for the sourcefile!!??) if the source file is more than a certain number of characters. Otherwise works well so far.

2. Is there a way to limit file selection to certain file types/extensions (e.g., MP3, WAV

This computer is running XP Pro, QM version 2.1.8.8

Thanks in advance for any and all help.

Cheers,

Steve Murphy

--------------
Here's the code if it helps, should run anywhere:

Code:
Copy      Help
;(a) = original text
;(t) = date
;(z) = lowercase(a)
;(u) = underscores instead of spaces in (z)
;(zz) final format (t_u.mp3)


str t zz a
t.time("%Y%m%d")
;...
;g1
;...


inp- a "Enter Event Name:" "FTP Uploader"
if a = 0
,
,if mes("Event Name Cannot Be Blank! Please Re-Enter." "Error:" "OC1xt")='O'
,,goto g1
str z=a
,z.lcase
str u=z
,u.replacerx(" " "_")
,zz.from("C:\qm\" t "_" u ".mp3")
,,
str s
,if(BrowseForFolder(s "c:\qm\" 1 "Select File"))
,,cop s zz
,,
,,
,,

,
,


Attached Files Image(s)
   


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)