hello again,
i got the image thing working, but i have anoter error. another part of my app is that im going to tell the user what kind of iPod they have (generation, colour, etc), i have the code, and it works in applescript, but it doent in xcode
global oneGenIPod, twoGenIPod, threeGenIPod, fourGenIPod, u2grey, u2colour, u2s, Colour, fiveGBlack, fiveGWhite, fiveGs, oneGSil, oneGBlu, oneGPin, oneGGre, oneGGol, oneGMini, shuff, nanoWhite, nanoBlack, nanos, allPods
set oneGenIPod to {"M8513", "M8541", "M8697", "M8709"} --include in list
set twoGenIPod to {"M8737", "M8740", "M8738", "M8741"} --include in list
set threeGenIPod to {"M8976", "M8946", "M9460", "M9244", "M8948", "M9245"} --include in list
set fourGenIPod to {"M9282", "M9268"} --include in list
set u2grey to "M9787"
set u2colour to "MA127"
set u2s to {u2grey, u2colour} --include in list
set Colour to {"MA079", "M9829", "M9585", "M9586", "M9830"} --include in list
set fiveGWhite to {"MA002", "MA003"}
set fiveGBlack to {"MA146", "MA147"}
set fiveGs to {fiveGWhite, fiveGBlack} --include in list
set oneGSil to "M9160"
set oneGBlu to "M9436"
set oneGPin to "M9435"
set oneGGre to "M9434"
set oneGGol to "M9437"
set oneGMini to {oneGSil, oneGBlu, oneGPin, oneGGre, oneGGol} --include in list
set twoGSil to {"M9800", "M9801"}
set twoGBlu to {"M9802", "M9803"}
set twoGPin to {"M9804", "M0805"}
set twoGGre to {"M9806", "M9807"}
set twoGMini to {twoGSil, twoGBlu, twoGPin, twoGGre} --include in list
set shuff to {"M9724", "M9725", "MA133"} --include in list
set nanoWhite to {"MA350", "MA004", "MA005"}
set nanoBlack to {"MA352", "MA099", "MA107"}
set nanos to {nanoWhite, nanoBlack} --include in list
set allPods to {oneGenIPod, twoGenIPod, threeGenIPod, fourGenIPod, Colour, u2s, fiveGs, oneGMini, twoGMini, shuff, nanos}
set yourPod to choose folder
display dialog getPodType(yourPod)
on getPodGen(thePod)
set prefs to ("Volumes:" & thePod & "iPod_Control:Device:SysInfo")
set theSysInfo to open for access file prefs
set theInfo to read theSysInfo
set theStart to (offset of "ModelNumStr: " in theInfo) + 13
set theEnd to theStart + 4
set theGen to read theSysInfo from theStart to theEnd
close access theSysInfo
return theGen
end getPodGen
on getPodType(thePod)
set theGen to getPodGen(thePod)
if theGen is in item 1 of allPods then
return "You are using a 1G iPod"
else if theGen is in item 2 of allPods then
return "You are using a 2G iPod"
else if theGen is in item 3 of allPods then
return "You are using a 3g iPod"
else if theGen is in item 4 of allPods then
return "You are using a 4G iPod"
else if theGen is in item 5 of allPods then
return "You are using a Colour/Photo iPod"
--else if theGen is in item 6 of allPods then
else if theGen is in item 1 of item 6 of allPods then
return "You are using a greyscale U2 iPod"
else if theGen is in item 2 of item 6 of allPods then
return "You are using colour U2 iPod"
--end if
--else if theGen is in item 7 of allPods then
else if theGen is in item 1 of item 7 of allPods then
return "You are using a White 5G iPod"
else if theGen is in item 2 of item 7 of allPods then
return "You are using a Black 5G iPod"
--end if
--else if theGen is in item 8 of allPods then
--{oneGSil, oneGBlu, oneGPin, oneGGre, oneGGol}
else if theGen is in item 1 of item 8 of allPods then
return "You are using a Silver 1G iPod Mini"
else if theGen is in item 2 of item 8 of allPods then
return "You are using a Blue 1G iPod Mini"
else if theGen is in item 3 of item 8 of allPods then
return "You are using a Pink 1G iPod Mini"
else if theGen is in item 4 of item 8 of allPods then
return "You are using a Green 1G iPod Mini"
else if theGen is in item 5 of item 8 of allPods then
return "You are using a Gold 1G iPod Mini"
--end if
--else if theGen is in item 9 of allPods then
--{twoGSil, twoGBlu, twoGPin, twoGGre}
else if theGen is in item 1 of item 9 of allPods then
return "You are using a Silver 2G iPod Mini"
else if theGen is in item 2 of item 9 of allPods then
return "You are using a Blue 2G iPod Mini"
else if theGen is in item 3 of item 9 of allPods then
return "You are using a Pink 2G iPod Mini"
else if theGen is in item 4 of item 9 of allPods then
return "You are using a Green 2G iPod Mini"
--end if
else if theGen is in item 10 of allPods then
--remember to ask if they want to store files anyways, even tho they can't read then
return "You are using an iPod Shuffle"
--else if theGen is in item 11 of allPods then
else if theGen is in item 1 of item 11 of allPods then
return "You are using a White iPod Nano"
else if theGen is in item 2 of item 11 of allPods then
return "You are using a Black iPod Nano"
--end if
end if
end getPodType
once i put the code in xcode, and use the method to assign the iPod type to a text field, my app gives me an error (The variable allPods is not defined. (-2753)). if anyone has any ideas id appreciate any help.
thanks,
Z
Model: PowerBook G4
AppleScript: 1.10.3
Browser: Safari 417.8
Operating System: Mac OS X (10.4)