Re: pdftotext
Re: pdftotext
- Subject: Re: pdftotext
- From: Shane Stanley <email@hidden>
- Date: Sun, 22 Dec 2013 12:32:48 +1100
On 22 Dec 2013, at 2:46 AM, Deivy Petrescu <email@hidden> wrote:
> For instance, the example you gave for list and sets, [...] why would I go to such lengths if it is a one liner in python or php ?
I have no idea what it is in php or python, but I think you're missing the point. The idea is that you can copy-and-paste the code into a file, save it as a library, and essentially use it as a black box. It could be written in python or anything else, for all that it matters. It happens that AppleScriptObjC handles certain things well and quickly, and doing it this way means that a user with a bit of initiative can probably tweak it further if it doesn't match their needs.
The code the user has to write is going to be the one-liner -- and it's going to be in plain, vanilla AppleScript. No do shell script, no second language, no allowing for zero-based indexing, no worrying about quoting and character encoding, yada, yada.
(And if you look through the code, many of the handlers are just one- or two-liners. Any complexity comes from wrapping it as a script object precisely to keep it simple from the user's perspective.)
That's not to say it doesn't have its limitations. It won't treat dates as you might expect in a set, for instance. But it will round-trip them, as well as things like aliases. That's something you lose once you start using do shell script and other languages.
> I believe the great power of AS is its simplicity. And even though it is simple it is still very powerful.
> So, may be for me, ASOC came at a price, it certainly it opens many other doors but we have to relearn everything again.
You don't have to relearn things: you use libraries, and you have the option of learning extra things. The sky isn't falling.
> I personally don’t know what is bette r going the ASOC way or full fledge Objective-C.
They're generally two answers to entirely different questions, though. If you want to write an app, sure, use Objective-C. But if you have a list of names and addresses from Mail or whatever and you want to sort them before passing them to some other app, Objective-C is useless (unless you put it in a framework and call it via AppleScriptObjC).
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden