Path in ASObjC XCode

Hi,

in my Applescript written With AppleScriptEditor i use Path :

Now in Xcode i want to write these Part in follow ways:


script PDFFilesAppDelegate
	property parent : class "NSObject"
	property pdfList : {} -- table data of pdf list
        property pdfPath : "Macintosh HD:Users:michael:Documents:EDV OCR" -- doesent works
	property pdfPath : "Macintosh HD/Users/michael/Documents/EDV OCR" -- doesent works too
        set pdfPath to "Macintosh HD/Users/michael/Documents/EDV OCR" -- doesent works too
        set pdfPath to "Macintosh HD/Users/michael/Documents/EDV OCR" -- doesent works too

	on applicationWillFinishLaunching_(aNotification)
		tell application "Finder"
			set my pdfList to name of files of pdfPath -- it doesent work
                        set my pdfList to name of files of home -- this line work very well
		end tell
	end applicationWillFinishLaunching_
	
	on applicationShouldTerminate_(sender)
		-- Insert code here to do any housekeeping before your application quits 
		return current application's NSTerminateNow
	end applicationShouldTerminate_
	
end script

thanks for help

Michael

Hi,

it doesn’t work anyway because you’re trying to get the files of a literal string, not of a folder
this should work if the string path is a HFS path (colon separated


 set my pdfList to name of files of folder pdfPath 

just do it the classical way


on applicationWillFinishLaunching_(aNotification)
		set pdfPath to (path to documents folder as text) & "EDV OCR:"
		tell application "Finder"
			set my pdfList to name of files of folder pdfPath -- it does work
		end tell
	end applicationWillFinishLaunching_

hi Stefan,

it doesnt work to.
can i send you the xcode file?

Thanks Michael

it must work, I tested it by logging the result

Of course you can send me the Xcode file.
If the PM does not support attaching files send me a mail then you get an answer (in german :wink: ) with the address

A tip for anyone emailing an Xcode project: Throw out the build folder first. It reduces the size dramatically, and gets rebuilt when the recipient opens the project.