Re: Strange problem with quotes running away and hiding!
Re: Strange problem with quotes running away and hiding!
- Subject: Re: Strange problem with quotes running away and hiding!
- From: Michael Terry <email@hidden>
- Date: Mon, 30 Jun 2003 16:12:27 -0700
On 6/30/03 3:19 PM, "Steven D. Majewski" <email@hidden> wrote:
>
on unixfiletype(pathname)
>
if pathname contains ":" then set pathname to POSIX path of pathname
>
set res to do shell script "file " & (quoted form of pathname)
>
return first word in text (offset of ":" in res) thru (length of res)
>
of res
>
end unixfiletype
Sorry, I can't really help you with your problem, but I thought it might be
interesting for you to know that you can refer to the text relative to the
end of a string using -n notation. So in this case:
return first word in text (offset of ":" in res) thru -1 of res
Maybe not too helpful here, but you can imagine if the substring didn't go
all the way to the end of the line:
"##### string #####"
result's text 7 thru -7
--> "string"
Mike
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.