• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: need some help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: need some help


  • Subject: Re: need some help
  • From: Christopher Stone <email@hidden>
  • Date: Sat, 19 Feb 2011 04:26:19 -0600

Hey Shane,

On Feb 19, 2011, at 04:04, Shane Stanley wrote:
On 19/2/11 8:21 PM, "Christopher Stone" <email@hidden> wrote:
One thing you might (or might not) want to consider is that in AppleScriptObjC, underscores are significant in handler names (they replace Cocoa's colons). So if you think you might be taking the plunge at some stage, use of underscores like this might be a habit to reconsider.

Thanks for the info.  When the time comes I'll make the necessary changes.

Technically that's different from the shell version in that under 10.5 and later it's writing MacRoman rather than the do shell script's UTF8 (and before 10.5 the encoding will depend on the class of someText). It won't matter with "on" and "off", but it might matter with real strings.

On occasion.  I have another handler for dealing with data-types:

-----------------------------------------------------------------------------
# WRITE DATA TO FILE HANDLER                               2010-11-03 : 19:02
-----------------------------------------------------------------------------
on Write_To_File(someData, targetFile, startingAtPosition, dataType)
try
set resultNumber to open for access targetFile with write permission
if startingAtPosition = 0 then
set eof of resultNumber to 0
else if startingAtPosition = "EOF" then
set startingAtPosition to get eof of resultNumber
end if
write someData to resultNumber ¬
as dataType ¬
starting at startingAtPosition
close access resultNumber
on error errMsg number errNum
try
close access resultNumber
end try
display dialog "Error: " & errMsg & return & "Error Number: " & errNum
end try
end Write_To_File

--
Best Regards,
Chris
 _______________________________________________
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

References: 
 >Re: need some help (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: need some help
  • Next by Date: Re: List of all applications
  • Previous by thread: Re: need some help
  • Next by thread: need some help
  • Index(es):
    • Date
    • Thread