Post

Replies

Boosts

Views

Activity

Reply to AppleScript pass variables to shell script
Errors in folder actions will fail silently unless you trap them. You can use a try statement, but in your snippet you are ignoring any errors, such as:AppleScript itself doesn't know about file names, so you need to use something that does, such as Finder;The shell uses spaces as delimiters between arguments, so you need to make sure they are used as needed when appending the various text items;File paths should be quoted or special characters (spaces, etc) otherwise escaped to prevent misinterpretations.I don't know the purpose of passing the folder name in addition to the full path (also note that a list of the dropped items are passed to the handler in the added_items argument), but after fixing the above items, your snippet would be something like:on adding folder items to this_folder after receiving added_items try tell application "Finder" to set filename to name of this_folder set p to quoted form of POSIX path of this_folder do shell script "/path/to/script " & p & space & quoted form of filename on error errmess number errnum display alert "Error " & errnum message errmess end try end adding folder items to
Mar ’20
Reply to Can we integrate and use a library written in python in iOS app?
Apps need to be self-contained and can't read or write data outside their containers, or download or execute code that change its features or functionality, but there are applications in the store that contain interpreters to run code - Pythonista, for example (not to mention web browsers). But yes, for a library it would be better to build one from Python code rather than embedding a multi-megabyte interpreter for it.
Dec ’19