Quote from PaulJonestindall on December 3, 2021, 1:40 pmI want to copy only PDF files from one browser to another by drag and drop. If I drag multiple files where one of them is not a PDF I can cancel the whole drop easy enough. But I can't seem to be able to filter out the the non-PDF files and still copy just the PDFs. Here is what I've tried so far:
:FMFTP_DropFile fmSetDelimiter ";" StrParse "[FMFTP.EventSourceFile]" ";" "[filecount]" "[filecount]" Loop "1" "[filecount]" "[filecountloop]" ExtractFileExt "[filecount[filecountloop]]" "[pdfYN]" If "[pdfYN]" "<>" ".pdf" SetVar "[filecount[filecountloop]]" "" EndIf EndLoop Loop "1" "[filecount]" "[filecountloop]" SetVar "[FMFTP.EventSourceFile]" "[FMFTP.EventSourceFile];[filecount[filecountloop]]" EndLoop SubStr "[FMFTP.EventSourceFile]" "1" "1" "[SemicolonYN]" If "[semicolonYN]" "=" ";" StrDel "[FMFTP.EventSourceFile]" "1" "1" "[FMFTP.EventSourceFile]" EndIf StrReplace "[FMFTP.EventSourceFile]" ";;" ";" "[FMFTP.EventSourceFile]" "" ReturnThis still copies the non-PDF files.
Suggestions?
I want to copy only PDF files from one browser to another by drag and drop. If I drag multiple files where one of them is not a PDF I can cancel the whole drop easy enough. But I can't seem to be able to filter out the the non-PDF files and still copy just the PDFs. Here is what I've tried so far:
:FMFTP_DropFile fmSetDelimiter ";" StrParse "[FMFTP.EventSourceFile]" ";" "[filecount]" "[filecount]" Loop "1" "[filecount]" "[filecountloop]" ExtractFileExt "[filecount[filecountloop]]" "[pdfYN]" If "[pdfYN]" "<>" ".pdf" SetVar "[filecount[filecountloop]]" "" EndIf EndLoop Loop "1" "[filecount]" "[filecountloop]" SetVar "[FMFTP.EventSourceFile]" "[FMFTP.EventSourceFile];[filecount[filecountloop]]" EndLoop SubStr "[FMFTP.EventSourceFile]" "1" "1" "[SemicolonYN]" If "[semicolonYN]" "=" ";" StrDel "[FMFTP.EventSourceFile]" "1" "1" "[FMFTP.EventSourceFile]" EndIf StrReplace "[FMFTP.EventSourceFile]" ";;" ";" "[FMFTP.EventSourceFile]" "" Return
This still copies the non-PDF files.
Suggestions?
Quote from PaulJonestindall on December 3, 2021, 4:33 pmI've come up with a partial solution.
I've come up with a partial solution.
Quote from mishem on December 3, 2021, 6:04 pmIf I understand the meaning of the variables correctly.
:FMFTP_DropFile fmSetDelimiter ";" .Not necessarily if it doesn't change anywhere. This is the default value. StrParse "[FMFTP.EventSourceFile]" ";" "[FileName]" "[count]" Loop "1" "[count]" "[i]" ExtractFileExt "[FileName[i]]" "[pdf]" If "[pdf]" "=" ".pdf" SetVar "[Temp]" "[Temp][FileName[i]];" EndIf EndLoop SetVar "[FMFTP.EventSourceFile]" "[Temp]" SetVar "[Temp]" "" Return
If I understand the meaning of the variables correctly.
:FMFTP_DropFile fmSetDelimiter ";" .Not necessarily if it doesn't change anywhere. This is the default value. StrParse "[FMFTP.EventSourceFile]" ";" "[FileName]" "[count]" Loop "1" "[count]" "[i]" ExtractFileExt "[FileName[i]]" "[pdf]" If "[pdf]" "=" ".pdf" SetVar "[Temp]" "[Temp][FileName[i]];" EndIf EndLoop SetVar "[FMFTP.EventSourceFile]" "[Temp]" SetVar "[Temp]" "" Return
Quote from PaulJonestindall on December 6, 2021, 10:15 pm@mishem
I don't think it lets me change the [FMFTP.EventSourceFile] variable. It keeps returning with my original selected files.
Thanks. I've figured out another option/solution using the ksDrop plugin.
I don't think it lets me change the [FMFTP.EventSourceFile] variable. It keeps returning with my original selected files.
Thanks. I've figured out another option/solution using the ksDrop plugin.