Page 2 of 2
Re: Dropping files to Flash/External drive folders
Posted: 15 Feb 2013 16:31
by klownboy
Don, to avoid reposting the same script...it's the 1st post with the following minor change in the menu line. I added a comment to the first post.
Code: Select all
"Select Flash Drive Folder|:wipe" load self(file);
and also try the line:
Code: Select all
"Select Flash Drive Folder|:wipe" load *;
Obviously the script may not run properly if you don't have a removable drive installed or you haven't changed the pre-set folders.
Thanks,
Ken
Re: Dropping files to Flash/External drive folders
Posted: 15 Feb 2013 17:27
by admin
Thanks, but no time for this now. If you happen to find a minimal script to reproduce the problem I can look into it.
Re: Dropping files to Flash/External drive folders
Posted: 15 Feb 2013 19:25
by klownboy
Don, as I said above I'm not sure it is a problem. Here are 2 shortened and butchered scripts that you can try when you have time (certainly no rush - when you have breathing time - your change works) and follow the modified direction in the dialog boxes. I don't want to repeat what I said above, but the first script illustrates the 'resource' error message when using load self(file) in the menu heading, and the the 2nd script illustrates the execution of "_Terminate" twice when using load * in the same menu heading. Drag a file onto the scripts to run it.
Code: Select all
"_Initialize"
perm $Flash_Folder, $Rem_Dr;
$Rem_Dr = get("drives", 3), "|");
$Dr_Cnt = gettoken($Rem_Dr, "count", "|");
msg "You have $Dr_Cnt drive(s) installed!";
$Rem_Dr = inputselect("Select the Target Drive - Don, for testing only<crlf>select C:\:","$Rem_Dr", | ,4, ,350, 250, "Target Drive Selection");}
"_Main";
"Select Drive Folder - Don for testing select this heading instead of a menu item on the first pass, C:\ on the second pass.|:wipe" load self(file);
"-"
" $Rem_Dr&";
sub _drop_it;
" $Rem_Dr&Windows";
sub _drop_it;
" $Rem_Dr&Program Files";
sub _drop_it;
"_drop_it";
if (<get drop |> == ""){
status "Nothing to do" , , "alert";
}
else {
$Flash_Folder = ($Rem_Dr . gettoken(caller("caption"), -1, "&", "t"));
if (exists($Flash_Folder) >= 1) {
copyto $Flash_Folder, <get drop |>;
}
else {
msg "This path doesn't exist!";
}
}
"_Terminate"
unset $Flash_Folder; unset $Rem_Dr;
The 2nd script:
Code: Select all
"_Initialize"
perm $Flash_Folder, $Rem_Dr;
$Rem_Dr = get("drives", 3), "|");
$Dr_Cnt = gettoken($Rem_Dr, "count", "|");
msg "You have $Dr_Cnt drive(s) installed!";
$Rem_Dr = inputselect("Select the Target Drive - Don, for testing only<crlf>select C:\:","$Rem_Dr", | ,4, ,350, 250, "Target Drive Selection");}
"_Main";
"Select Drive Folder - Don for testing select this heading instead of a menu item on the first pass, C:\ on the second pass.|:wipe" load *;
"-"
" $Rem_Dr&";
sub _drop_it;
" $Rem_Dr&Windows";
sub _drop_it;
" $Rem_Dr&Program Files";
sub _drop_it;
"_drop_it";
if (<get drop |> == ""){
status "Nothing to do" , , "alert";
}
else {
$Flash_Folder = ($Rem_Dr . gettoken(caller("caption"), -1, "&", "t"));
if (exists($Flash_Folder) >= 1) {
copyto $Flash_Folder, <get drop |>;
}
else {
msg "This path doesn't exist!";
}
}
"_Terminate"
unset $Flash_Folder; unset $Rem_Dr;
Thanks,
Ken
Re: Dropping files to Flash/External drive folders
Posted: 16 Feb 2013 12:36
by admin
Probably fixed the load self(file) thing...
Re: Dropping files to Flash/External drive folders
Posted: 16 Feb 2013 14:13
by klownboy
Thanks Don. I'm not sure the 2nd situation (load *) needs fixing.

It seems to make sense that "_Terminate" would run again due to the reload (i.e., original stack and stack 1), but maybe that could be detected and prevented.
Re: Dropping files to Flash/External drive folders
Posted: 16 Feb 2013 15:14
by admin
Maybe, not sure yet.
Re: Dropping files to Flash/External drive folders
Posted: 18 Feb 2013 13:44
by klownboy
As you said the load self(file) issue we discussed did go away. I can't remember the version number, but it's gone for me as well.
Thanks,
Ken