New topic: Cannot launch FolderItems on Mac
<http://forums.realsoftware.com/viewtopic.php?t=30500> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message 404notfound Post subject: Cannot launch FolderItems on MacPosted: Thu Oct 15, 2009 1:54 pm Joined: Wed Jul 15, 2009 1:02 pm Posts: 3 I'm trying to open PDF and HTML files by launching them with their default programs. This works fine with the Windows version of my app, but it doesn't work on Mac. More specifically, nothing happens when the menu item to open the file is selected, even though I have a MsgBox that's supposed to pop up if the FolderItem is nil. Code:dim f as FolderItem f = GetFolderItem("docs/cb/manual.pdf") if f = nil then MsgBox "Help file is not present. Please check application files or use alternative help method." else f.launch end I've tried using an #if block to replace the slashes with colons for OSX, thinking that the directory syntax might be the culprit, but it's not. It seems like a relatively simple problem, yet I can't find the solution. Any help would be appreciated. Top DaveS Post subject: Re: Cannot launch FolderItems on MacPosted: Thu Oct 15, 2009 3:21 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 1662 Location: San Diego, CA Try this.... alway check F.exists.... Code:dim f as FolderItem f = GetFolderItem("docs/cb/manual.pdf") if f = nil then MsgBox "Help file is not present. Please check application files or use alternative help method." else if f.exists then f.launch else msgbox "Cannot find "+f.absolutepath end if end _________________ Dave Sisemore MacPro, OSX 10.5.8 RB2009r2 Top jefftullin Post subject: Re: Cannot launch FolderItems on MacPosted: Thu Oct 15, 2009 4:59 pm Joined: Wed Nov 15, 2006 3:50 pm Posts: 841 Code:f = GetFolderItem("docs/cb/manual.pdf") Thats a file and folder relative to the built app. The folder and help file will not exist in the debug folder: does this work in the distribution folder but not the debug? Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
