RE: AppleScript bug?
RE: AppleScript bug?
- Subject: RE: AppleScript bug?
- From: "Scott Babcock" <email@hidden>
- Date: Tue, 25 Jan 2005 11:49:40 -0800
- Thread-topic: AppleScript bug?
This looks like a missing "implied get" event. In most cases, AppleScript will let you omit the 'get' event from expressions and just does it for you under the covers. In this case, the implied 'get' isn't being performed.
Adding an explicit 'get' event achieves the desired result:
count (get paragraphs of ("" as Unicode text))
--> 1
-----Original Message-----
Content-Type: text/plain; charset="us-ascii"
On 1/24/05 7:28 PM, "Hanaan Rosenthal" <email@hidden> wrote:
> If someone could explain the following I would be very grateful:
>
> count paragraphs of ""
> result: 1
>
> count paragraphs of ("" as Unicode text)
> result: 0
But
paragraph 1 of ""
--> ""
paragraph 1 of ("" as Unicode text)
--> "" --(Unicode)
So it must be a bug.
--
Paul Berkowitz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.apple.com/mailman/private/applescript-users/attachments/20050124/18430367/attachment.html
------------------------------
Message: 15
Date: Mon, 24 Jan 2005 21:41:54 -0800
From: Andrew Oliver <email@hidden>
Subject: Re: Image Capture
To: "Andrew C. Bairnsfather" <email@hidden>,
<email@hidden>
Message-ID: <BE1B1C22.31E7B%email@hidden>
Content-Type: text/plain; charset="US-ASCII"
On 1/24/05 9:30 PM, "Andrew C. Bairnsfather" <email@hidden> wrote:
> I searched the archives and posted to the Discussion forums (AppleScript and
> 10.3 Customization). In the archives I found one question like mine, back in
> 2002, but no answer.
>
> http://lists.apple.com/archives/applescript-users/2002/Jun/msg00636.html
>
> I wrote this script to automatically unmount the camera chip and quit Image
> Capture. The idea being that once the images have been downloaded all I have
> to do is unplug the USB cord.
>
> tell application "Finder"
> try
> eject "CHIP_NAME"
> on error
> -- Oops.
> end try
> end tell
>
> delay 1
>
> tell application "Image Capture"
> try
> quit
> on error
> -- Oops.
> end try
> end tell
[snip]
Rule 1 when debugging: remove any and all 'try/end try' statements.
That way the script will fail and post a dialog noting the error. While it
probably doesn't solve the problem it should hint where to start looking.
I'd hazard a guess that the problem relates to the Finder not being able to
eject a string (which is what your disk is trying to do). It might be worth
trying:
...
eject disk "CHIP_NAME"
...
Andrew
:)
------------------------------
Message: 16
Date: Tue, 25 Jan 2005 07:56:58 +0000
From: Rob Stott <email@hidden>
Subject: Re: Reading a pdf text file
To: Applescript Users List <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset="iso-8859-1"
On 9 Jan 2005, at 15:44, Richard Smykla wrote:
> After installing the xpdf-tools package, the command-line tool
> pdftotext can be found in the /sw/bin/ directory. (At least that is
> where it installed by default on my machine.) You can then use a
> simple Applescript 'do script' command to create a text version of
> your pdf.
Hi all,
I've been following this thread with interest. I have the following
chunk of applescript...
set pdfPosixPath to POSIX path of (choose file with prompt "Please find
the PDF")
set outputPosixPath to (pdfPosixPath & ".txt")
set theResult to do shell script ("/usr/local/pdftotext -eol mac opw
1234 -raw " & quoted form of pdfPosixPath & " " & quoted form of
outputPosixPath & " ; cat " & outputPosixPath)
...this works exactly as I wanted for my English files, but certain
'foreign' characters come out strangely, for example the German
character "ΓΌ". Apparently adding the option "-enc utf-8" should work so
we end up with...
set theResult to do shell script ("/usr/local/pdftotext -eol mac opw
1234 -raw -enc utf-8 " & quoted form of pdfPosixPath & " " & quoted
form of outputPosixPath & " ; cat " & outputPosixPath)
...but for some reason this doesn't seem to work at all - am I doing
something daft? Does anyone have any suggestions?
Any hints would be appreciated,
Thanks in advance
Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 3181 bytes
Desc: not available
Url : http://lists.apple.com/mailman/private/applescript-users/attachments/20050125/bdbbaeba/attachment.bin
------------------------------
Message: 17
Date: Tue, 25 Jan 2005 01:13:12 -0700
From: Michelle Steiner <email@hidden>
Subject: Re: Mail question
To: Rob Lewis <email@hidden>
Cc: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed
On Jan 24, 2005, at 9:35 PM, Rob Lewis wrote:
> The command to get item 1 of a list fails?!
That's because "selection" doesn't return a list, although it looks
like a list. "class of selection" results in the same failure that you
got with "item 1 of selection".
For reasons that I still am not able to understand, although it's been
stated here a number of times, "item 1 of (get selection)" and "class
of (get selection)" work.
-- Michelle
--
"My country, right or wrong: if right, to be kept right; and if wrong,
to be set right."
Senator Carl Schurz of Missouri, 1899
------------------------------
Message: 18
Date: Tue, 25 Jan 2005 02:38:13 +0100
From: Tor Langballe <email@hidden>
Subject: Finding message id in Mail is slooow?
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed
I want to open a message I allready have the message id for in Mail.
I've concluded I have to write:
set mylist to every message whose message id is "xxx"
On my 2300 mail inbox (with attachments, probably close to a gig), this
is SLOW AS EVER, minutes, and my machine in almost frozen.
Am I correct in assuming it has to work its way thru the whole mailbox,
reading the message id's?
Is there no caching/indexing involved at all?
If so, Is there anybody else that finds this completly unusable?
What's the point of message id's if they take forever to look up?
Regards,
Tor Langballe
--------------------------------------------------------
CUTTING EDGE TECHNOLOGIES
Bogstadveien 5B, 0355 OSLO, Norway
Fax: +47 2256 4770
------------------------------
_______________________________________________
Applescript-users mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/applescript-users
End of Applescript-users Digest, Vol 2, Issue 52
************************************************
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden