alphawarrior2000 Posted January 13, 2007 Author Share Posted January 13, 2007 Revised the function just a tad, but nothing that would have effected the previous one. #include <array.au3> $aArray = _FileOpenDialogArray("Choose file(s)", @MyDocumentsDir, "All (*.LNK)", 4 + 1) _ArrayDisplay($aArray, '') Func _FileOpenDialogArray($sTitle, $sInitDir, $sFilter, $nOptions = Default, $sDefaultName = '') Local $sDialog = FileOpenDialog($sTitle, $sInitDir, $sFilter, $nOptions, $sDefaultName) If @error Then Return SetError(1, 0, '') If StringInStr($sDialog, '|') Then Local $aSplit = StringSplit($sDialog, '|'), $sHold = '' For $iCC = 2 To UBound($aSplit) - 1 $sHold &= $aSplit[1] & '\' & $aSplit[$iCC] & Chr(1) Next Return StringSplit(StringTrimRight($sHold, 1), Chr(1)) EndIf Local $aArray[2] = [1,$sDialog] Return $aArray EndFunc This worked fine for me: I typed: "File One" "File Two" In the dialog for Multiple files, and it returned the result I expected. Then I mistyped one of them and it returned an error as it should (File could not be found). Is the conclusion that I can't copy multiple *.lnk files at once with this software? I copied and pasted your code, and I got the same error when I selected more than one *.lnk file. I apperciate your help. Link to comment Share on other sites More sharing options...
alphawarrior2000 Posted January 13, 2007 Author Share Posted January 13, 2007 Xcal, if you add a 1 to your flag, the same error will occur as well in your code. It's not that I don't understand how to handle these files gentlemen... it's that whenever you try to select more than one *.lnk file, it errors out. Try this Smoke_n, is there a way we can create a function that will copy multiple *.lnk files from one location to the next using FileGetShortcut and FileCreateShortcut? Thanks. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 13, 2007 Moderators Share Posted January 13, 2007 Is the conclusion that I can't copy multiple *.lnk files at once with this software? I copied and pasted your code, and I got the same error when I selected more than one *.lnk file. I apperciate your help.Well, I've tested the above code many times now, and it does in fact work for me on OS XP Pro SP2. I hadn't tested it in any other environment though. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
xcal Posted January 13, 2007 Share Posted January 13, 2007 Xcal, if you add a 1 to your flag, the same error will occur as well in your code. It's not that I don't understand how to handle these files gentlemen... it's that whenever you try to select more than one *.lnk file, it errors out. Try this Smoke_n, is there a way we can create a function that will copy multiple *.lnk files from one location to the next using FileGetShortcut and FileCreateShortcut?Thanks.I don't get that error. Smoke_n's solution works fine for me, too. How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
alphawarrior2000 Posted January 13, 2007 Author Share Posted January 13, 2007 Well, I apperciate all the help. It seems for whatever reason... the program does not recognize specific .LNK files as if they are not there. Looks like there's nothing that can be done here. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 13, 2007 Moderators Share Posted January 13, 2007 FileSelectFolder() + _FileListToArray() (or maybe even _FileListToArrayEx()) + FileCopy() should be fine. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
alphawarrior2000 Posted January 14, 2007 Author Share Posted January 14, 2007 FileSelectFolder() + _FileListToArray() (or maybe even _FileListToArrayEx()) + FileCopy() should be fine.Well, as if it wasn't obvious, I am a newb programmer... but I tried with the _filelisttoarray and I couldn't get anything to copy. However, I will just use what we already developed and go from there. I apperciate all the help. Link to comment Share on other sites More sharing options...
GaryFrost Posted January 14, 2007 Share Posted January 14, 2007 The file(s) giving you a problem wouldn't happen to have any special characters in the name would they? SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
alphawarrior2000 Posted January 14, 2007 Author Share Posted January 14, 2007 The file(s) giving you a problem wouldn't happen to have any special characters in the name would they?No, but most of the files even the ones that work have spaces in them. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 14, 2007 Moderators Share Posted January 14, 2007 No, but most of the files even the ones that work have spaces in them.Spaces sometimes require double quotes before and after the actual string. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now