handy applescript

Paul Mulroney pmulroney at logicaldevelopments.com.au
Mon Aug 14 23:24:37 UTC 2023


Hi Kelly,

Thank you for your generosity in utility!  Now, if only there was a Windows way to do the same thing ...

Regards,
Paul

> On 14 Aug 2023, at 5:18 pm, Phil (OmnisList) <phil at pgpotter.co.uk> wrote:
> 
> Hey Kelly,
> 
> You first released this some time ago, and I religiously update it with the later codes...
> 
> a useful little 'droplet' tool, so thanks.
> 
> regards
> Phil Potter
> Based in Chester in the UK.
> 
> On 13/08/2023 12:00, Kelly Burgess wrote:
>> I just revised a 'droplet' tool I have, adding Studio 11 awareness. This is a compiled Applescript app whose icon you can drag and drop an Omnis library onto, and it will tell you which version of Studio it was last used with. Saves you from launching a library with the wrong version, having to decline the offer to convert or deal with the 'can't read library' error when there's a version mismatch.
>> 
>> If you don't use Macs, it also serves as a list of the first-byte values you can hex-edit to back-convert a library in some cases.
>> 
>> Paste this script into Apple's Script Editor and save it as a run-only Application that doesn't stay open.
>> 
>> Kelly
>> 
>> 
>> 
>> on open files_
>> 	repeat with file_ in files_
>> 		set file_ to POSIX path of file_
>> 		-- read the first three bytes
>> 		set foo to (open for access (POSIX file file_))
>> 		set txt to (read foo for 3)
>> 		close access foo
>> 		-- map bytes to version
>> 		set byteOne to ASCII number (first character of txt)
>> 		set byteTwo to ASCII number (second character of txt)
>> 		set byteThree to ASCII number (third character of txt)
>> 		set dialogMsg to file_ & " is not a Studio 3 or Studio 4 library."
>> 		if byteTwo = 1 then -- 0x01
>> 			if byteOne = 44 then -- 0x2C
>> 				set dialogMsg to file_ & " is a Studio 3.x library."
>> 			end if
>> 			if byteOne = 45 then -- 0x2D
>> 				set dialogMsg to file_ & " is a Studio 4.x library."
>> 			end if
>> 			if byteOne = 46 then -- 0x2E
>> 				set dialogMsg to file_ & " is a Studio 4.3.1+ library."
>> 			end if
>> 			if byteOne = 47 then -- 0x2F
>> 				set dialogMsg to file_ & " is a Studio 5.0.x library."
>> 			end if
>> 			if byteOne = 48 then -- 0x30
>> 				set dialogMsg to file_ & " is a Studio 5.1.x library."
>> 			end if
>> 			if byteOne = 49 then -- 0x31
>> 				set dialogMsg to file_ & " is a Studio 5.2.x library."
>> 			end if
>> 			if byteOne = 50 then -- 0x32
>> 				set dialogMsg to file_ & " is a Studio 6.0.x library."
>> 			end if
>> 			if byteOne = 51 then -- 0x33
>> 				set dialogMsg to file_ & " is a Studio 6.1.x library."
>> 			end if
>> 			if byteOne = 52 then -- 0x34
>> 				set dialogMsg to file_ & " is a Studio 8.0.x library."
>> 			end if
>> 			if byteOne = 53 then -- 0x35
>> 				set dialogMsg to file_ & " is a Studio 8.1.x library."
>> 			end if
>> 			if byteOne = 54 then -- 0x36
>> 				set dialogMsg to file_ & " is a Studio 10.0.x library."
>> 			end if
>> 			if byteOne = 55 then -- 0x37
>> 				set dialogMsg to file_ & " is a Studio 10.1.x library."
>> 			end if
>> 			if byteOne = 56 then -- 0x38
>> 				set dialogMsg to file_ & " is a Studio 10.2.x library."
>> 			end if
>> 			if byteOne = 57 then -- 0x39
>> 				set dialogMsg to file_ & " is a Studio 11.0.x library."
>> 			end if
>> 			if byteThree = 1 then
>> 				set dialogMsg to dialogMsg & " (Unicode)"
>> 			end if
>> 		end if
>> 		display dialog dialogMsg buttons {"OK"} default button "OK"
>> 	end repeat
>> end open
>> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 




  <https://www.logicaldevelopments.com.au/>	Paul W Mulroney
Logical Developments
Customised Software Solutions
Ph: 08 9458 3889
 	We Don't Do Simple Pty Ltd
trading as
Logical Developments
ACN 161 009 374
 	  <https://www.facebook.com/logicaldevelopmentswa/>   <https://twitter.com/WeDontDoSimple>   <https://www.linkedin.com/company/logicaldevelopments/>   <https://www.youtube.com/channel/UCPldVVgWR05WX3cVrR5WUQw>


More information about the omnisdev-en mailing list