Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Our Archives > General Archives > Delicious Monster > Importing a list of UPCs?

 
Importing a list of UPCs?
Thread Tools
hellspawn
Fresh-Faced Recruit
Join Date: Oct 2008
Status: Offline
Oct 18, 2008, 04:44 PM
 
Hi!

I have a complete list of UPCs of my DVD collection as a text file.
Can I somehow import this list into DL2 so that I don't have to scan the barcode of every single DVD?
     
absenthanded
Fresh-Faced Recruit
Join Date: Jun 2008
Location: Raleigh, NC
Status: Offline
Oct 31, 2008, 05:21 PM
 
With a little applescript, I bet you could.

If you post a sample of your text file, I'll take a whack at a starter script for you.
     
hellspawn  (op)
Fresh-Faced Recruit
Join Date: Oct 2008
Status: Offline
Nov 1, 2008, 03:17 AM
 
Thanks for answering!
The file just contains the UPCs of every DVD I own, one per line, like
Code:
012236119579 012236120650 ...
If necessary, I could put other information in that file.
     
absenthanded
Fresh-Faced Recruit
Join Date: Jun 2008
Location: Raleigh, NC
Status: Offline
Nov 5, 2008, 08:12 PM
 
I fiddled with this and I think I've come up with something that can work for you.

Open Script Editor and paste this (except for the line that reads "Code:") into it:
Code:
set UPCs to {} tell application "Finder" set UPCFile to (choose file with prompt "Select UPC file") open for access UPCFile set UPCs to (read UPCFile using delimiter linefeed) close access UPCFile end tell tell first document of application "Delicious Library 2" repeat with ean in UPCs look up ean end repeat end tell
Save it, run it, etc. You can put somewhere under /Users/<user name>/Library/Scripts/Applications/Delicious Library 2/ if you want to run it directly from DL2's script menu.

I didn't do any extensive testing on the script, but I tried it with some bogus UPCs and DL2 just passed over the garbage UPCs without complaining.

Let me know how the script works for you.
     
hellspawn  (op)
Fresh-Faced Recruit
Join Date: Oct 2008
Status: Offline
Nov 7, 2008, 05:03 AM
 
Thanks for the script! Unfortunately it's not working for me.
I added a "display dialog ean" statement and it shows that the numbers are read correctly, but nothing shows up in DL.
I think "look up" does only that and not insert a new item.
So one probably has to create a "medium" object based on the looked up data and then use "add medium to shelf" statement.
Sadly, I don't know how to do this :-(
     
absenthanded
Fresh-Faced Recruit
Join Date: Jun 2008
Location: Raleigh, NC
Status: Offline
Nov 7, 2008, 02:07 PM
 
Hmm. When I put the two UPCs you list above in a file, the script inserted Basic Instinct and Total Recall into my library. I wonder why it worked for me, but not for you.

I'll dig around a bit more tonight and see what else I can find; you're probably right about the "add medium to shelf" bit being necessary.
     
absenthanded
Fresh-Faced Recruit
Join Date: Jun 2008
Location: Raleigh, NC
Status: Offline
Nov 15, 2008, 11:45 PM
 
It still works for me, and the example scripts only use "look up ean" as well.

Sorry That's as far as I can go with it.
     
hellspawn  (op)
Fresh-Faced Recruit
Join Date: Oct 2008
Status: Offline
Nov 16, 2008, 03:40 PM
 
Ok, thanks anyway!
     
 
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 08:02 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,