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

ExtendScript - Folder.changePath() Difficulties

Contributor ,
Dec 13, 2019 Dec 13, 2019

Hello, I am attempting to move 1 folder into another using the Folder.changePath() method built into ES. However, I am having issues getting the path right, or understanding what is required in the argument.

 

var moveme = Folder("C:/Users/Nate/Documents/moveme");

var movehere = Folder("C:/Users/Nate/Documents/movehere");

moveme.changePath("../../");
//moveme.changePath(movehere.getRelativeURI());

 

TOPICS
Scripting
719
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

Community Expert , Dec 16, 2019 Dec 16, 2019

People typically use rename for moving files:

 

var s = new Folder('~/Desktop/test.png')
s.rename('~/Desktop/folder/test.png')
Translate
LEGEND ,
Dec 14, 2019 Dec 14, 2019

You are not doing anything to cancatenate the strings. The function uses absloute references. You cannot expect it to just append the two levels up prefix.

 

Mylenium

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
Contributor ,
Dec 14, 2019 Dec 14, 2019

Care to help me out? I've tried using relative and absolute URI and paths to no avail. How and what are you concatenating? 

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
Community Expert ,
Dec 16, 2019 Dec 16, 2019

People typically use rename for moving files:

 

var s = new Folder('~/Desktop/test.png')
s.rename('~/Desktop/folder/test.png')
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
Contributor ,
Dec 19, 2019 Dec 19, 2019
LATEST

A bit confused by your code. Why do you use a folder object to represent a .png file? 

If this is how you move files, how can I move a folder and all the contents within it?

 

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