Hi Guys,
I have been going round and round on this for 3 days trying to figure out a way to do this. Basically, I am handing AS a text file that has a list of files to be downloaded from an FTP site.
I use a unique to find out which I have already downloaded and then once I know the ones I need to download, I begin the repeat cycle to download each file. The issue I run into is:
I run the spaces through a Text Item Delimiter to change the to "\ ". Because terminal translates spaces as "\ " and this character is an ignoring character in AS, it gives me strange results. I then thought, I would just ignore with an ignore "\ ". This however adds double \ in my output.
You can see in line 11 the log looks write, however when I take this filename and pass it to my shell script, the error is on 16. It has "\ " instead of "\ " any thoughts?
1"tell current application
2 do shell script “curl ‘ftp://website.org/Spot/’ --user ‘user:pass’ --list-only > ~/ftpNew.txt”
3 → “”
4 do shell script “sort ~/ftpOld.txt ~/ftpNew.txt | uniq -u”
5 → “Test A File With Spaces.rtf”
6 (Test A File With Spaces.rtf)
7 (1)
8 (Test A File With Spaces.rtf)
9 (‘/Test A File With Spaces.rtf’)
10 (T, e, s, t, \ , A, \ , F, i, l, e, \ , W, i, t, h, \ , S, p, a, c, e, s, ., r, t, f)
11 (FinalName is Test\ A\ File\ With\ Spaces.rtf)
12 open for access file “~/FileForUpload.txt” with write permission
13 → 161
14 write “Test\ A\ File\ With\ Spaces.rtf” to 161 starting at eof
15 close access 161
16 do shell script “curl ‘ftp://website.org/Spot/Test\\ A\ File\ With\ Spaces.rtf’ --user ‘user:pass’ -o ~/Desktop/Test\ A\ File\ With\ Spaces.rtf”
17 → error " % Total % Received % Xferd Average Speed Time Time Time Current
18 Dload Upload Total Spent Left Speed
19
20 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
21 curl: (78) RETR response: 550" number 78
22 Result:
23 error " % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
curl: (78) RETR response: 550" number 78