Move File From Hot Folder after Completion

Explorer ,
Dec 16, 2016 Dec 16, 2016

Copy link to clipboard

Copied

Looking for the line of script that would move a file from the HotFolder In to the Out Folder once it's done running the script...

I have a script built to perfom certain functions and save a new .pdf... but I want to simply thing in the end by being able to grab the original and the altered file in the same OUT folder once the job is done...

Thanks for any help

TOPICS
Scripting

Views

364

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Valorous Hero , Dec 19, 2016 Dec 19, 2016
Normally the File Object reference reports a "move' function but I think it's kind of bugged so the safest way is to copy then remove original filevar someFileToBeMoved = File ("/some/path");var outFolder = Folder ( "/some/folder/path" );var copied = someFileToBeMoved.copy ( File ( outFolder+"/"+someFileToBeMoved.name ) );if ( copied ) { someFileToBeMoved.remove();}else {     alert("The file couldn't be moved");}

Likes

translate

Translate

Translate
Valorous Hero ,
Dec 19, 2016 Dec 19, 2016

Copy link to clipboard

Copied

Normally the File Object reference reports a "move' function but I think it's kind of bugged so the safest way is to copy then remove original file

var someFileToBeMoved = File ("/some/path");

var outFolder = Folder ( "/some/folder/path" );

var copied = someFileToBeMoved.copy ( File ( outFolder+"/"+someFileToBeMoved.name ) );

if ( copied ) {

someFileToBeMoved.remove();

}

else {

     alert("The file couldn't be moved");

}

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 19, 2016 Dec 19, 2016

Copy link to clipboard

Copied

Thanks... I'll give that a try... your logic makes sense, and I started to wonder if this wouldn't be the better direction...

Thanks for your help

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines