View Single Post
FallenAsh

 
Member Since: Jun 24, 2012
Posts: 2
FallenAsh is on a distinguished road

FallenAsh is offline
Quote:
Originally Posted by Mark FX View Post
It's been a while since I have done any Applescript, but I think the problem with your code is, the choose folder command returns an HFS style path as an alias, and you want to pass a POSIX style path as an escaped string to the do shell script command, so you have to convert the returned HFS alias into a POSIX path, and then use the quoted form of command, to convert it into an escaped string, that you then use in the shell script.

Code:
set destinationFolder to choose folder with prompt "Choose the destination folder to save the image file."
set destinationFolderPosixPath to POSIX path of destinationFolder
do shell script "ls " & quoted form of destinationFolderPosixPath
That helped a fair bit yes!

I spent quite a few hours researching how to add folder and things to shell and POSIX seemed the way to go. In the end I came up with this, which works perfectly:

Code:
set the destination to (choose folder)
try
do shell script "curl -L www.startofurl.com/" & USERVARIABLE & "'endofurl.php'" & " -o " & quoted form of ((POSIX path of the destination) & USERVARIABLE & "word" & ".png")
QUOTE Thanks