Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Delete file when done

Participant ,
Dec 28, 2015 Dec 28, 2015

I have a script that I am running through a hot folder and when it is finished I would like to delete the file from it's folder.  I have tried a few different things but to no avail I can not get it to work.  Any suggestions? Or can this be done?

TOPICS
Scripting
1.2K
Translate
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

Participant , Dec 29, 2015 Dec 29, 2015

GOT IT.  Thanks V.  File should have been a variable.

var file = (File("Users/mycomputer/Desktop/Hot Folder/Layout.pdf"));

file.remove();

Translate
Adobe
Valorous Hero ,
Dec 28, 2015 Dec 28, 2015

have you tried File.remove() ?

Translate
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
Participant ,
Dec 29, 2015 Dec 29, 2015

Here is what I was trying but get a File.remove is not a function.

var  docname = activeDocument.name;

var layoutDoc = (File("/Users/mycomputer/Desktop/" +  docname));

File.remove(layoutDoc);

Translate
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
Participant ,
Dec 29, 2015 Dec 29, 2015

GOT IT.  Thanks V.  File should have been a variable.

var file = (File("Users/mycomputer/Desktop/Hot Folder/Layout.pdf"));

file.remove();

Translate
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 07, 2016 Dec 07, 2016

Would you care to share how you set-up a hot folder... PC/MAC...??? Wanting to do the same thing...

Thanks

Translate
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
Participant ,
Feb 25, 2017 Feb 25, 2017
LATEST

Use Automator folder action . You will have to learn some basic apple script but not to complicated.

Translate
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