| 27913 | } |
| 27914 | |
| 27915 | bool Process::openDocument (const String& fileName, const String& parameters) |
| 27916 | { |
| 27917 | #if JUCE_IOS |
| 27918 | return [[UIApplication sharedApplication] openURL: [NSURL URLWithString: juceStringToNS (fileName)]]; |
| 27919 | #else |
| 27920 | JUCE_AUTORELEASEPOOL |
| 27921 | |
| 27922 | if (parameters.isEmpty()) |
| 27923 | { |
| 27924 | return [[NSWorkspace sharedWorkspace] openFile: juceStringToNS (fileName)] |
| 27925 | || [[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString: juceStringToNS (fileName)]]; |
| 27926 | } |
| 27927 | |
| 27928 | bool ok = false; |
| 27929 | const File file (fileName); |
| 27930 | |
| 27931 | if (file.isBundle()) |
| 27932 | { |
| 27933 | NSMutableArray* urls = [NSMutableArray array]; |
| 27934 | |
| 27935 | StringArray docs; |
| 27936 | docs.addTokens (parameters, true); |
| 27937 | for (int i = 0; i < docs.size(); ++i) |
| 27938 | [urls addObject: juceStringToNS (docs[i])]; |
| 27939 | |
| 27940 | ok = [[NSWorkspace sharedWorkspace] openURLs: urls |
| 27941 | withAppBundleIdentifier: [[NSBundle bundleWithPath: juceStringToNS (fileName)] bundleIdentifier] |
| 27942 | options: 0 |
| 27943 | additionalEventParamDescriptor: nil |
| 27944 | launchIdentifiers: nil]; |
| 27945 | } |
| 27946 | else if (file.exists()) |
| 27947 | { |
| 27948 | ok = FileHelpers::launchExecutable ("\"" + fileName + "\" " + parameters); |
| 27949 | } |
| 27950 | |
| 27951 | return ok; |
| 27952 | #endif |
| 27953 | } |
| 27954 | |
| 27955 | void File::revealToUser() const |
| 27956 | { |
nothing calls this directly
no test coverage detected