Re: How to adjust this script to work on Snow Leopard?
Re: How to adjust this script to work on Snow Leopard?
- Subject: Re: How to adjust this script to work on Snow Leopard?
- From: KOENIG Yvan <email@hidden>
- Date: Mon, 22 Nov 2010 11:29:14 +0100
Le 22 nov. 2010 à 10:14, Bert Groeneveld a écrit : Hi,
This (part of a) script only runs on 10.5.8 and not on 10.6. Could anyone tell how to adjust this snippet to make it compatible with 10.6?
set ProductGroups to open_TXT_File() end tell
- - - - - - - Background info: - - - - - - -
The (Intel) Mac with IP address 192.168.10.21 still has Mac OS 10.5.8 Server installed. I didn't change anything on that Mac. The application "Open_ProductGroups_Server_v01" is a simple (stay open) applescript that runs on the server and contains the following handler:
on open_TXT_File() set myFile to "Fotostudio-ServerDisk:B:BIJENKORF TEST MAP BERT AFBLIJVEN:Productgroups:ProductGroups.txt" set myTXT_File to open for access myFile set ProductGroups to read myTXT_File set AppleScript's text item delimiters to " " set ProductGroups to every text item of ProductGroups set AppleScript's text item delimiters to "" close access myTXT_File return ProductGroups end open_TXT_File
I guess that the culprit is the handler.
set myTXT_File to open for access file myFile
would be better.
I would edit the handler this way :
on open_TXT_File() set myFile to "Fotostudio-ServerDisk:B:BIJENKORF TEST MAP BERT AFBLIJVEN:Productgroups:ProductGroups.txt" set myTXT_File to open for access file myFile set ProductGroups to read myTXT_File close access myTXT_File
set AppleScript's text item delimiters to " " set ProductGroups to every text item of ProductGroups set AppleScript's text item delimiters to "" return ProductGroups end open_TXT_File
which close the text file immediately when there is no need to leave it open.
Yvan KOENIG (VALLAURIS, France) lundi 22 novembre 2010 11:28:46
|
_______________________________________________
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