• 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
tab delimiter problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tab delimiter problem


  • Subject: tab delimiter problem
  • From: Brian Christmas <email@hidden>
  • Date: Sat, 06 Aug 2011 15:53:13 +1000

G'ay scripters.

I've been working on an ASOC project under Lion, using Shane's ebook as a guide, and have struck a problem.

This line doesn't seem to work, set AppleScript's text item delimiters to {tab} , the tabs seem to be being ignored. I've checked the file, and it's definitely tab delineated. Instead of getting an anEntry of 15, it's counting the whole lot of the characters of theEntry.

Is there something wrong under 4.1 and lion?

Regards

Santa



    on importDataAsTabbedText_() 
         --set theAlarms to current application's newAlarm's alloc()'s init()
        tell theArrayController
removeObjects_(arrangedObjects())
end tell
        try
             set thefiletemp to theFile as alias
            end try
        try
             set theEntries to paragraphs of (read theFiletemp as text) 
            set oldDelims to AppleScript's text item delimiters
            set AppleScript's text item delimiters to {tab} 
        repeat with  anEntry  in theEntries
            say count of theEntries
            say count of anEntry
            set (theActiveStoreVariable,theStartDateStoreVariable,theTypeStoreVariable,theDaysStoreVariable,theMonthsStoreVariable,theWeeksStoreVariable,theTextStoreVariable,theSpeakStoreVariable,theVoiceStoreVariable,theiTunesStoreVariable,thePlaylistStoreVariable,thePlaylistRandomStoreVariable,theVolumeStoreVariable,theDisplayFlagStoreVariable,theMessageDisplayStoreVariable) to text items of anEntry 
             set anEntry to {}
            set tempdate to (my ASDateToNSDate_(theStartDateStoreVariable )) 
            set end of anEntry to {theActiveColumn:theActiveStoreVariable,theStartDateColumn:tempdate,theTypeColumn:theTypeStoreVariable,theDaysColumn:theDaysStoreVariable,theMonthsColumn:theMonthsStoreVariable,theWeeksColumn:theWeeksStoreVariable,theTextColumn:theTextStoreVariable,theSpeakColumn:theSpeakStoreVariable,theVoiceColumn:theVoiceStoreVariable,theiTunesColumn:theiTunesStoreVariable,thePlaylistColumn:thePlaylistStoreVariable,thePlayListRandomColumn:thePlaylistRandomStoreVariable,theVolumeColumn:theVolumeStoreVariable,theDisplayFlagColumn:theDisplayFlagVariable,theMessageDisplayColumn:theMessageDisplayStoreVariable} 
            say 4
            tell theArrayController to addObjects_(anEntry) 
        end repeat
        set AppleScript's text item delimiters to oldDelims
  on error errmsg
        display dialog errmsg
        end try
    end importDataAsTabbedText_ 



 _______________________________________________
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: tab delimiter problem
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Grabbing the current URL of a webview
  • Next by Date: Re: tab delimiter problem
  • Previous by thread: Re: Doubling issue
  • Next by thread: Re: tab delimiter problem
  • Index(es):
    • Date
    • Thread