Re: How to access raw data (as seen in chevron syntax)
Re: How to access raw data (as seen in chevron syntax)
- Subject: Re: How to access raw data (as seen in chevron syntax)
- From: KOENIG Yvan <email@hidden>
- Date: Wed, 7 Jul 2010 22:31:50 +0200
In fact it's really easy to get the raw datas in memory. Just use this
short script :
--[SCRIPT]
(*
Assume that you copied the picture in the clipboard
*)
set the_picture to the clipboard as picture
try
the_picture as text (* of course, it will issue an error *)
on error errMsg number errNbr
(*
The error message resemble to that :
Il est impossible de rendre «data
PICT00000000000000470070001102FF0C00FFFE00000048000000480000000000000047007000000000001E0001000A0000000000470070820000005DCA000000010000000000000000000000000000000100000000000000000000000000004000000000000000000000000000000000000000000000470070000003000000000000000056726177200000000000000000000000006170706C000004000000040000700047004800000048000000005D30000100000000000000000000000000000000000000000000000000000000000000000018FFFFA4B0A4A1ADA195A092838E807D85767D85767F8C7D83908486988C899E9592A99F99B4AD9DBBB39DBCB6A1C1BBA9C9C3AECEC3AACABFA3C3B6A1C1B4A5C6B6AACBBBA9CABD89ADA16D938669928979A49A89B7AF92C4BB9DCBC3A2CAC…
*)
log errMsg
set errMsg to item 2 of my decoupe(errMsg, "«") (* Use the opening
chevron to split the message and keep only what is after the chevron. *)
set errMsg to item 1 of my decoupe(errMsg, "»") (* Use the closing
chevron to split the message and keep only what is before the chevron.
*)
end try
(*
I put it in the clipboard but you may use it as you want.
*)
set the clipboard to errMsg
(*
data
PICT00000000000000470070001102FF0C00FFFE00000048000000480000000000000047007000000000001E0001000A0000000000470070820000005DCA000000010000000000000000000000000000000100000000000000000000000000004000000000000000000000000000000000000000000000470070000003000000000000000056726177200000000000000000000000006170706C000004000000040000700047004800000048000000005D30000100000000000000000000000000000000000000000000000000000000000000000018FFFFA4B0A4A1ADA195A092838E807D85767D85767F8C7D83908486988C899E9592A99F99B4AD9DBBB39DBCB6A1C1BBA9C9C3AECEC3AACABFA3C3B6A1C1B4A5C6B6AACBBBA9CABD89ADA16D938669928979A49A89B7AF92C4BB9DCBC3A2CAC…
*)
--=====
on decoupe(t, d)
local oTIDs, l
set oTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe
--[/SCRIPT]
Yvan KOENIG (VALLAURIS, France) mercredi 7 juillet 2010 22:31:33
_______________________________________________
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