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: 1484987" data-attributes="member: 211556"><p>Well done for getting it working, dont forget the "end try" statement in your code snippet is missing it.</p><p>Also consider using an error trap in your try statements, this will help you debug your code much easier, when things go wrong, also you can use the error trap to display a dialog bog to the user, with a useful desciption of the fault.</p><p></p><p>Like this.</p><p></p><p>[CODE]</p><p>try</p><p> -- Some code that might cause an error</p><p>on error error_message number error_number</p><p> return "Error" & space & error_message & space & error_number as text</p><p>end try</p><p>[/CODE]</p><p></p><p>And yes your correct, shell scripts only understand POSIX paths, where Applescript commands usually return a HFS colon delimited path, unless otherwise you convert it,</p><p>also you need to escape the POSIX path string, in case it contains spaces or other unsupported characters.</p><p></p><p>Good luck with it.</p><p></p><p>Regards Mark</p></blockquote><p></p>
[QUOTE="Mark FX, post: 1484987, member: 211556"] Well done for getting it working, dont forget the "end try" statement in your code snippet is missing it. Also consider using an error trap in your try statements, this will help you debug your code much easier, when things go wrong, also you can use the error trap to display a dialog bog to the user, with a useful desciption of the fault. Like this. [CODE] try -- Some code that might cause an error on error error_message number error_number return "Error" & space & error_message & space & error_number as text end try [/CODE] And yes your correct, shell scripts only understand POSIX paths, where Applescript commands usually return a HFS colon delimited path, unless otherwise you convert it, also you need to escape the POSIX path string, in case it contains spaces or other unsupported characters. Good luck with it. Regards Mark [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Applescript Curl and Variable Help
Top