I can’t find out what I’m doing wrong I get this message.
This is my code
tell save panel
set title to "Extract Resource to"
set prompt to "Extract"
set required file type to "iprs"
set treat packages as directories to false
end tell
set theResult to display save panel with file name "iPod Resource"
if theResult is 1 then
set rspath to (path name of save panel as string)
do shell script "mkdir " & (quoted form of rspath)
try
do shell script "mkdir " & (quoted form of (rspath & "/pics"))
end try
tell application "Finder"
set images to (files of (rspath & "/bmap/"))
end tell
repeat with i from 1 to the count of images
display dialog POSIX path of (item i of images as alias)
end repeat
end if
tell save panel
set title to "Extract Resource to"
set prompt to "Extract"
set required file type to "iprs"
set treat packages as directories to false
end tell
set theResult to display save panel with file name "iPod Resource"
if theResult is 1 then
set rspath to path name of save panel
do shell script "mkdir -p " & quoted form of (rspath & "/pics")
tell application "System Events"
set images to files of POSIX file (rspath & "/bmap")
end tell
repeat with i from 1 to the count of images
display dialog POSIX path of (item i of images)
end repeat
end if
.or, without the Finder, taking some of Bruce’s suggestions
tell save panel
set title to "Extract Resource to"
set prompt to "Extract"
set required file type to "iprs"
set treat packages as directories to false
end tell
set theResult to display save panel with file name "iPod Resource"
if theResult is 1 then
set rspath to (path name of save panel)
try
do shell script "mkdir -p " & quoted form of (rspath & "/pics")
end try
set foundPics to paragraphs of (do shell script "find '" & rspath & "/bmap/' -maxdepth 1 -type f ! -name '.*'")
repeat with i in foundPics
display dialog i
end repeat
end if
Note: there will be displayed two slashes (//) in the path. It doesn’t matter to process the files