Hi
Ive been using the piece of code below in on of my Apple Script Xcode project’s now for quite a few years with no issues
i’m now trying to use it in a ASOC Xcode project, but it seem’s to not work as the previous code did, ive hooked everything up correctly yet it does not appear to return the found item from the current path, does it look like iv’e missed something?, or do i need to add some extra code?, any ideas welcome please.
set _path to quoted form of POSIX path of "RIP FILES:"
set _selecteditem to title of current menu item of popup button "_itemlist" of window "main" as text
set f to paragraphs of (do shell script "/usr/bin/find " & _path & " -type f -name '" & _selecteditem & "'")
if f is not {""} then
set FileToOpen to (POSIX file (item 1 of f)) as alias
set baseName to do shell script ("basename -s ." & (name extension of (info for FileToOpen)) & " " & (quoted form of (POSIX path of FileToOpen)))
if (baseName contains return) then -- Process folder or file without an extension].
set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set baseName to text item 2 of baseName
set AppleScript's text item delimiters to oAStid
end if
if baseName contains "FOO" then
--DO STUFF
ASOC CODE
set _path to quoted form of POSIX path of "RIP FILES:"
set productType to aPopupMenu's titleOfSelectedItem() --bound to popup via property aPopupMenu in IB
set _selecteditem to productType as string
set f to paragraphs of (do shell script "/usr/bin/find " & _path & " -type f -name '" & _selecteditem & "'")
if f is not {""} then
set FileToOpen to (POSIX file (item 1 of f)) as alias
set baseName to do shell script ("basename -s ." & (name extension of (info for FileToOpen)) & " " & (quoted form of (POSIX path of FileToOpen)))
if (baseName contains return) then -- Process folder or file without an extension].
set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set baseName to text item 2 of baseName
set AppleScript's text item delimiters to oAStid
end if
if baseName contains "FOO" then
--DO STUFF
end if
end if