Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Applescript Curl and Variable Help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Mark FX" data-source="post: 1484282" data-attributes="member: 211556"><p>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.</p><p></p><p>Like this example.</p><p></p><p>[CODE]</p><p>set destinationFolder to choose folder with prompt "Choose the destination folder to save the image file."</p><p>set destinationFolderPosixPath to POSIX path of destinationFolder</p><p>do shell script "ls " & quoted form of destinationFolderPosixPath</p><p>[/CODE]</p><p></p><p>Copy and paste this code into Applescript Editor and run it.</p><p></p><p>Hope this helps.</p><p></p><p>Regards Mark</p></blockquote><p></p>
[QUOTE="Mark FX, post: 1484282, member: 211556"] 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. Like this example. [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 [/CODE] Copy and paste this code into Applescript Editor and run it. Hope this helps. Regards Mark [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Applescript Curl and Variable Help
Top