Is there an easy way to use the Copy File, Copy Folder Commands with an Excel file? The code below fails because it is expecting it to be coded as UTF-8
set dataresults to file(ResourcePath(datafilename))
set archivelocation to "\bheggplant\Repository\Archived_Bots_and_Drones_Data"
Copy file dataresults into folder archivelocation
Thanks,
Dave
I think it’s failing because Eggplant Functional doesn’t support UNC paths. I wouldn’t think the file encoding would matter at all since it’s using the system calls to do the copy. I was just able to copy an xlsx file from one folder to another with no issues.
Is it possible that ePF behaves differently in Windows than on the Mac?
There are occasional differences (generally documented) but this isn't one of them and I tested this on Windows.
In your second example, I think Sensetalk is failing on the first line. When you do "set var to file x", you're reading the file into the variable. You can't do that with an Excel file because it's a binary format. You'll notice the first error says "failed to copy"; the second one doesn't even suggest that it tried. A Workbook is an object inside the file, so you're not reading the contents, and it's being accessed via an Excel API.
And your first example isn't going to work because you've set data results to be a workbook object and then you're trying to pass that to "file" which is expecting a string defining the path to a file. I think this should work:
set dataresults to ResourcePath("data_BAD-1.xlsx")
set archivelocation to "R:/Archived_Bots_and_Drones_Data"
Copy file dataresults into folder archivelocation
Sorry I missed that the first time through.