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 6183913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:26:48+00:00 2026-05-24T01:26:48+00:00

I am making an AppleScript application with AppleScript 2.2 on Mac OS X 10.7

  • 0

I am making an AppleScript application with AppleScript 2.2 on Mac OS X 10.7 (Build: 11A511) Lion. What my application is doing is capturing the current iTunes song and storing it if the song is different from the last one. Then I told it to take the the current song and place it into an SQLite file using Database Events. Basically it is adding the current song to a new field, but when the song changes it says that there are no old fields and then writes the song (the process repeats…); I do have a save after it makes the field.

My code is as follows:

        if currentsong is not equal to previous_song then

    tell application "Database Events"
        tell database "songlist"
            set song to make new record with properties {name:"songs"}
            set song_count to count fields
            tell song
                make new field with properties {name:currentsong, value:song_count + 1}
            end tell
        end tell
        save database "songlist"
    end tell

end if
  • 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-05-24T01:26:49+00:00Added an answer on May 24, 2026 at 1:26 am

    It seems you’re a little confused by records and fields. A database has records and a record has fields. In your code you are telling the database to count the fields… which is a problem because a database has records, not fields.

    So change “fields” to “records” where you set the song_count. Also, if you want that count to be correct then put that line ahead of where you create the new record because you’re trying to get the count before you add a new record.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making an application that involves controlling Safari from Applescript. Is there a
im making an application where i have to load my database from html file
Im making a small private message application in the form of a phone. Ten
I've been trying to get any given window from another Application to become front
Making a quick JQuery demo where clicking a table element changes it from black
i making a application where i need total amount of data used by user
I am making an Automator application and I need to replace some text based
Im making a Zend Framework MVC application using the standard Zend MVC structure and
making a thumbnail from video using the picker is straight forward. However, when I
Im making a transition from Java to Flash/Actionscript and Im having sort of a

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.