File.Rename on Mac :/

Guys... I have this code, it works on Windows perfectly to rename the files.

I tried to make it work on Mac but I couldn't.

Is not display any errors / warning.

What I'm doing wrong, why he does not on Mac? :/


Thanks much in advance x)


var filenameEXT = "SST";
var mainPath = Folder.desktop + "/";
var fullPath = Folder.desktop + "/New Files/";
var f = File(mainPath + "EXT.svg");
if (f.exists) {
    f.rename(fullPath + filenameEXT + ".svg");
};

Which works properly on Windows?

/*
Both of the below should work fine on OS X, Your problem is in this line:
f.rename(fullPath + filenameEXT + ".svg"); // extra path reference is not needed, 'f' already declares it
*/

// Option 1:
var filenameEXT = "SST";
var mainPath = Folder.desktop + "/"; // Assumes SVG file is on Desktop
var f = File(mainPath + "EXT.svg");
if (f.exists) {
    f.rename(filenameEXT + ".svg"); // Error was here, extra path reference was not needed, 'f' already declares it
} else {
    alert(f+ " Was Not Found");
}

// Option 2:
var filenameEXT = "SST";
var fullPath = Folder.desktop + "/New Files/"; // Assumes SVG file is on Desktop, in folder 'New Files'
var f = File(fullPath + "EXT.svg");
if (f.exists) {
    f.rename(filenameEXT + ".svg"); // Error was here, extra path reference was not needed, 'f' already declares it
} else {
    alert(f+ " Was Not Found");
}

Hope this helps your efforts.

Tags: Illustrator

Similar Questions

  • How to recover my files from my Mac Pro stored in iCloud with my iPhone 6 s?

    How to recover my files from my Mac Pro iCloud with my iPhone more than 6 s

    iCloud Drive is shared between your devices as long as you are connected to the same Apple ID

    Log on to the same Apple ID and make sure that your iCloud drive is enabled in the settings > iCloud. You can also activate the show on desktop configuration.

  • Cannot open file reader iCloud Mac

    When I'm on my Mac and try to open files that are located in iCloud cross finder, it gives me an error message saying "the file 'name' could not be opened." I can access all the files when I go to icloud.com, but it won't let me see and use them from my Mac.

    You can check this thread: could not open the file on my mac iCloud

  • I m a new user of macbook. I can´t copy files from my mac to an external drive

    I can´t copy files from my mac to an external hard drive.

    I followed the instructions in the help, but I can't change the license to write / read of read-only, the locking doesn´t appear on my screen of inf.

    really I m very disappointed with this machine because I can´t find the apple online support.

    I tried searching you tobe to the google search, and I can't do it!

    any body can help me please?

    Select the drive in the Finder and select the get info in the file menu.

    If it is the Windows NT file system format, install software such as Paragon NTFS on the computer or reformat the hard disk.

    If it's in a different format, choose Utilities in the Finder Go menu, open disk utility and use the repair disk function or first aid in this regard.

    (143023)

  • Someone please tell me how open/read a file on my Mac OS Pro Tour/Yosemite .asf. Please help, frustrated!

    Someone please tell me how open/read a file on my Mac OS Pro Tour/Yosemite .asf. Please help, frustrated!

    of course, it's another format darn owner, so you will need a copy of Windows media player for mac.  (or VLC) there is a way to convert, however, but I suspect it will not free

    Good luck

    John B

  • How to save a file on my mac webscan

    When you use webscan hp7610 how to save the file on my mac?

    Hi roch4t,

    I understand that you have an Officejet 7610 and you're wanting to know how to record a webscan. I will definitely do my best to help you.

    I tested on our Mac 10.9 we have here and came with the screenshot below. Once the scan is finished, I held the CTRL key and clicking on (or if you have a two button mouse, you can just right click) on the analysis and got the drop-down list, you see at the bottom right and selected open in preview. Once it has opened in the preview, I was able to then click on file and save.

    Hope this helps, have a nice day!

  • How to share a music file from my mac to a long-distance iphone

    How to share a music file from my mac to a long-distance iphone

    Send it, although you will not be able to save in the music app.

  • My space free icloud is full, so I want to download all my files on my Mac and use a hard drive instead of icloud. I'm not happy to pay to store my files in icloud. How can I do this?

    My space free icloud is full, so I want to download all my files on my Mac and use a hard drive instead of icloud. I'm not happy to pay to store my files in icloud. How can I do this?

    Welcome to the Apple community.

    Locate in iCloud drive in your Finder, drag to where you want to save them on your Mac, confirm, you want to move them when the Finder prompts.

  • Search for a word in all my files on the mac HD

    Is there a function in the application of SEARCH to the search for a word or phrase in all my files to my Mac Book Pro HD?

    Have you tried spotlight and searched on "content?  See this discussion.

  • Can I drag and drop files from my Mac in the time Capsule to free up space on my Mac?

    I currently use my Time Capsule in sync with Time Machine as a return "where" upward... I would like to know if I can drag and drop files to transport CANADA to free up space on my Mac.

    I would like to know if I can drag and drop files to transport CANADA to free up space on my Mac.

    Yes, but the fact that you can do something does not suggest that it would be wise to do. Please take a minute to think about it per.

    If you delete files on your Mac for free space and move them to the TC... so that only one copy of these files you will be on the TC.  What will happen to the files when... not if... you have a problem with the TC?

    A plan much better, faster and more secure would be to add a USB to your Mac and move your files there. Then, Time Machine can back up your Mac and the USB attached to your Mac to the TC.  It would be a minimum backup... plan your files 'master' on the USB drive and 'backups' on the TC.

  • My Photosmart HP 5510 Scan photos in the file on my Mac running Yosemite

    I get an error message that the parsing failed everytime I try to scan a photo.  I downloaded the latest driver through the Apple App Store.  I rebooted the computer and the printer.  Help!

    Hi @JaneCat,

    Welcome to the HP Forums!

    I understand that you cannot scan pictures of your HP Photosmart 5510 to a file on your Mac of Yosemite. I'm sorry to hear that, but I'm happy to help you!

    I recommend to download the drivers and full software functionality of our Web site, HP Photosmart 5510 e - All - in - One printer full feature software and drivers, as it is compatible with Mac OS X Yosemite.

    If you still have questions, I also recommend this analysis guide, a Message appears "No computer found" during scanning. Then follow the steps in the section that says it's for, Mac OS X 10.6 Snow Leopard, OS X v10.7 Lion, v10.8 Mountain Lion OS X or OS X v10.9 Mavericks. Given that these steps will still work on Mac OS X Yosemite.

    I also see this how to scan guide, scanning with HP software full feature in OS X v10.10 Yosemite.

    Hope this information is useful and thanks for posting!

  • How can you get rid of "Please wait while the document is being prepared for reading" at the opening of a file on a mac?

    I read about the deletion of the file of the accessibility to the use of a pc.  Where are these files on a mac?

    And is there a better solution that can be reached in the preferences?

    Thank you

    Hi samc77346904,

    You can navigate to Edit > Preferences > select 'Read' in the categories and under "options" screen reader label select the drop down option "pages vs" menu and select "only read the currently visible pages" menu drop-down.

    Let us know if this solves your problem.

    Concerning

    Sarojini

  • Open the file created on Mac crashes on Windows

    Same version of first CC and it is a very small project.

    Closer to you, I do open was important as a new project, but when I tried to open the timeline, the accident occurs. I copied the files on usb, HDD external and then copied on my local disk. I deleted all the files in cache and then received the "Missing Renderer" message, but it still crashes. It's something in the timeline panel. But what? I can take the same file to a MAC and open it without problem.

    Hi Brucel,

    Same version of first CC and it is a very small project.

    Closer to you, I do open was important as a new project, but when I tried to open the timeline, the accident occurs. I copied the files on usb, HDD external and then copied on my local disk. I deleted all the files in cache and then received the "Missing Renderer" message, but it still crashes. It's something in the timeline panel. But what? I can take the same file to a MAC and open it without problem.

    Import this file into a new Premiere Pro project.

    But before you open the calendar, please change video renderer only in software mode.

    Click file > project settings > General and change of video rendering "Software Only Mode" and delete previews

    Thank you

    Ilyes Singh

  • How can I view the Photoshop files on my Mac to my iPad and iPhone?

    How can I view the Photoshop files on my Mac to my iPad and iPhone? I am new to Adobe products and understand with the latest version creative Cloud is no longer does.

    Hi leonoraw51296428,

    It is not possible to synchronize files from the computer to your phone.

    Then I suggest you to download and install the Application Photoshop (Photoshop Mix, or Photoshop Fix) on your phone.

    Kind regards

    Tanuj

  • 4.1.1 fusion erases files on the Mac desktop that are deleted in Fusion

    I have merge 4.1.1 installed on a MacBook Pro with Mac OS X 10.6.8.  If I download a file on the Mac desktop and then drag and drop it on the desktop of Windows XP which runs under Fusion, a box of "copy" just stating that the file is copied to the virtual machine.  If the file is 95MB, for example, copy the area shows the progress of the 95MB copy to the VM.  So far so good.  At the same time, a file is created on the Mac desktop which is a duplicate of the file slipped to the virtual operating system of Windows.  If I trash the file on the Mac desktop, it removes the file on the Windows desktop as well.  I-mode installation of VMware Fusion full screen and have a second monitor on the Mac, where I've been the VMware virtual machine.

    It's as if the file on the desktop Mac was in fact the only real file and one on the virtual machine has been a 'shortcut' or 'alias' in the file.  Not sure if I just something I have to change in the settings of merger to prevent this, or if this is normal behavior.

    Bill

    It seems that you have enabled the functionality of records at the Office for this Virtual Machine VMware Fusion mirror.  Check the settings of records in reverse in the Virtual Machine settings and uncheck the box office under folders in reverse.

Maybe you are looking for