• 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
How can I empty a .dat file in Xcode.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can I empty a .dat file in Xcode.


  • Subject: How can I empty a .dat file in Xcode.
  • From: Brian Christmas <email@hidden>
  • Date: Mon, 28 Sep 2015 09:48:53 +1000

G’day scripters

I’m trying to create a blank .dat file, using the code below.

While the code writes a blank entry when run in Applescript, it writes ‘list’ when used in my Xcode project.

It say the first ‘say’ statement, but not the second.

Why does it run differently? And where is the ‘list’ text coming from? Applescript is supposed to write an empty entry when no write statement is issued.

Can anyone tell me how to empty a .dat files in Xcode, please?

Regards

Santa



on writeFile9(theFileName, TheWriteItem)
try
if my runForOz then say "writing"
if (count of TheWriteItem) is 0 then set TheWriteItem to {}
tell application "Finder"
set theFileName to ((my pathtodesktop) & "ftp Downloads:" & theFileName as text)
set fRef to (open for access file theFileName with write permission)
set eof fRef to 0
try
if TheWriteItem ≠ {} then
if my runForOz then say "writing 2"
write TheWriteItem as list to fRef
end if
end try
close access fRef
end tell
on error errmsg number errnum
my setEMsgs:{errnum, "mainMessagesView", "writeFile9. Error number " & errnum & " Error " & errmsg as text, "Error Message Orange", true, "Cochin Bold", "14"}
end try
end writeFile9


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How can I empty a .dat file in Xcode.
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Want to remove Dock Icon
  • Next by Date: Re: How can I empty a .dat file in Xcode.
  • Previous by thread: Re: Want to remove Dock Icon
  • Next by thread: Re: How can I empty a .dat file in Xcode.
  • Index(es):
    • Date
    • Thread