 |
 |
Importing a list of UPCs?
|
 |
|
 |
Fresh-Faced Recruit
Join Date: Oct 2008
Status:
Offline
|
|
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?
|
|
|
|
|
|
 |
|
 |
Fresh-Faced Recruit
Join Date: Jun 2008
Location: Raleigh, NC
Status:
Offline
|
|
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.
|
|
|
|
|
|
 |
|
 |
Fresh-Faced Recruit
Join Date: Oct 2008
Status:
Offline
|
|
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.
|
|
|
|
|
|
 |
|
 |
Fresh-Faced Recruit
Join Date: Jun 2008
Location: Raleigh, NC
Status:
Offline
|
|
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.
|
|
|
|
|
|
 |
|
 |
Fresh-Faced Recruit
Join Date: Oct 2008
Status:
Offline
|
|
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 :-(
|
|
|
|
|
|
 |
|
 |
Fresh-Faced Recruit
Join Date: Jun 2008
Location: Raleigh, NC
Status:
Offline
|
|
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.
|
|
|
|
|
|
 |
|
 |
Fresh-Faced Recruit
Join Date: Jun 2008
Location: Raleigh, NC
Status:
Offline
|
|
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.
|
|
|
|
|
|
 |
|
 |
Fresh-Faced Recruit
Join Date: Oct 2008
Status:
Offline
|
|
|
|
|
|
|
|
 |
 |
|
 |
|
|
|

|
|
 |
Forum Rules
|
 |
 |
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |