Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8287155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:57:29+00:00 2026-06-08T11:57:29+00:00

I have a spreadsheet that our office uses for scheduling. Each tab represents a

  • 0

I have a spreadsheet that our office uses for scheduling. Each tab represents a month. I am able to export each tab to a file named month1.csv, month2.csv… etc. I have the following piece of code to open each months file and loop through it:

    repeat with b from 1 to 12
            tell application "Finder"
            set curFileName to (sourceFolder & "month" & b & ".csv") as string
            --display dialog curFileName
            set workingFile to read file (curFileName)
            --display dialog "File has been read"
            set AppleScript's text item delimiters to {ASCII character 13}
            set theContents to text items of workingFile as list
        end tell

do stuff with the csv...

end repeat

The script iterates through the first month and then when b = 2 I get this error:

Finder got an error: File file Macintosh HD:Users:lorenjz:Documents:Manpower:,month,2,.csv wasn’t found.

What do I need to do to eliminate this error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:57:30+00:00Added an answer on June 8, 2026 at 11:57 am

    Use the following line instead of yours. Basically you are trying to add text together to create a file path. However sourceFolder is not text so you must first make that into text before you can add more text to it. “b” is also not text so that has to be coerced to text too.

    In general applescript is good about coercing things for you. It basically tries to coerce everything into the class of the first object in the line. So if you make sourceFolder into text (it’s a file specifier unless you coerce it) then applescript will try to coerce everything after that to text… meaning that you really wouldn’t have to coerce “b” to text because applescript will do that for you… as long as souceFolder is text of course. I generally do the coercing myself though to make sure it is correct so I would generally also coerce “b” myself.

    The point is that when you add text together everything must be text. You can’t just put “as text” at the end of the line, you must coerce every individual item to text. Good luck.

    set curFileName to (sourceFolder as text) & "month" & (b as text) & ".csv"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Excel spreadsheet that uses a TFS query to pull information on
I have a google spreadsheet that uses this function: =SUM(E:E) - SUM(C:C) It adds
I have an Excel spreadsheet that needs to display data from our SQL database.
I have a spreadsheet that has several worksheets, each containing a hundred or so
Like many, I have spreadsheet that draws data from over 40 text files as
I have a spreadsheet that I am sorting based on an item number column.
I have an Excel spreadsheet that I have exported from some other program. It
I have an Excel spreadsheet that looks like: spreadsheet http://img186.imageshack.us/img186/6495/exelf.jpg I'd like to convert
I have an Excel spreadsheet that will sit out on a network share drive.
I have an excel spreadsheet that is password-protected. I need to open this spreadsheet

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.