 |
 |
AppleScripts?
|
 |
|
 |
Fresh-Faced Recruit
Join Date: Jun 2008
Status:
Offline
|
|
Hey guys, are there any neat AppleScripts for DL?
I'm looking for something that would help me strip the additional information Amazon adds to some of their releases (Blu-ray movies have [Blu-ray] and HD DVD has [HD DVD]). I have a couple hundred titles that are formatted this way, and it's a PITA to edit them all by hand. Anyone know of an AppleScript that could help me?
Thanks,
Gord
|
|
|
|
|
|
 |
|
 |
Fresh-Faced Recruit
Join Date: Jun 2008
Status:
Offline
|
|
Well, after spending a couple of hours playing around with AppleScript and DL, I don't think this is even possible. It doesn't seem as though I can pull the name of the title so I can strip something from it. Anyone else have any ideas?
Gord
|
|
|
|
|
|
 |
|
 |
Fresh-Faced Recruit
Join Date: Jun 2008
Location: Raleigh, NC
Status:
Offline
|
|
This script seemed to work for me. It assumes that all Blu-ray titles will end in " [Blu-ray]" and all HD DVD titles will end in " [HD DVD]" (note the leading spaces). If Amazon ever changes their titling system, this script won't work.
Anyway, dump this in "/Users/<your login>/Library/Scripts/Applications/Delicious Library 2" and give it a try.
(Don't include the "Code:" part. I don't know why, but the forum's CODE tag is inserting itself).
Code:
set oldDelims to AppleScript's text item delimiters
tell first document of application "Delicious Library 2"
set AppleScript's text item delimiters to ""
set BluRays to (every movie where its name contains " [Blu-ray]")
set BluRayLength to length of " [Blu-ray]"
repeat with BluRay in BluRays
set movieName to BluRay's name
set nameLength to the length of the movieName
set movieName to characters 1 thru -(BluRayLength + 1) of movieName as string
set BluRay's name to movieName
end repeat
set HDDVDs to (every movie where its name contains " [HD DVD]")
set HDDVDLength to length of " [HD DVD]"
repeat with HDDVD in HDDVDs
set movieName to HDDVD's name
set nameLength to the length of the movieName
set movieName to characters 1 thru -(HDDVDLength + 1) of movieName as string
set HDDVD's name to movieName
end repeat
end tell
set AppleScript's text item delimiters to oldDelims
|
|
|
|
|
|
 |
|
 |
Fresh-Faced Recruit
Join Date: Jun 2008
Status:
Offline
|
|
Thank you SO much! This is exactly what I was looking to do. If Amazon makes a change I can just edit this script. Thanks again.
Gord
|
|
|
|
|
|
 |
|
 |
Fresh-Faced Recruit
Join Date: Jun 2008
Location: Raleigh, NC
Status:
Offline
|
|
I'm still learning AppleScript, so this is mainly for my own edification.
Here's a version of the script that will be easier to change. Just put the types of discs you want cleaned up on the end of the DiscType list:
Code:
set DiscTypes to {" [HD DVD]"} & {" [Blu-ray]"}
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to ""
tell first document of application "Delicious Library 2"
repeat with DiscType in DiscTypes
set Discs to (every movie where its name contains DiscType)
set DiscTypeLength to length of DiscType
repeat with Disc in Discs
set movieName to Disc's name
set nameLength to the length of the movieName
set movieName to characters 1 thru -(DiscTypeLength + 1) of movieName as string
set Disc's name to movieName
end repeat
end repeat
end tell
set AppleScript's text item delimiters to oldDelims
|
|
|
|
|
|
 |
|
 |
Fresh-Faced Recruit
Join Date: Jun 2008
Status:
Offline
|
|
I assume it could be modified further to allow a user to input the text they want cleaned up, right, though only if it appears at the end of the title name?
Anyway, you saved me a ton of work edited all those titles, and I really appreciate it.
Gord
|
|
|
|
|
|
 |
|
 |
Junior Member
Join Date: Nov 2006
Status:
Offline
|
|
just a quick Thanks to abesenhanded from me to - that script has been a massive time saver
now i can get rid of the [UMD for PSP] as well as the (NTSC) and so on also
it's really quick too
cheers!!
|
-- ---
"one day we're all gonna die and then we'll see who's laughing"
|
|
|
|
|
 |
 |
|
 |
|
|
|

|
|
 |
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
|
|
|
|
|
|
 |
 |
 |
 |
|
 |