Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mac::apps::launch(3) [osx man page]

Launch(3)						User Contributed Perl Documentation						 Launch(3)

Mac::Apps::Launch - Mac module to launch /quit applications SYNOPSIS
use Mac::Apps::Launch; my @apps = qw(R*ch Arch MPGP); my $path = "HD:System Folder:Finder"; LaunchApps([@apps], 1) or warn $^E; # launch and switch to front LaunchApps([@apps]) or warn $^E; # launch and don't switch LaunchApps($app, 1) or warn $^E; # launch and switch to front LaunchSpecs($path, 1) or warn $^E; # use path instead of app ID QuitApps(@apps) or warn $^E; # quit all @apps QuitAllApps(@apps) or warn $^E; # quit all except @apps IsRunning('MACS'); # returns boolean for whether # given app ID is running SetFront('MACS') or warn $^E; # set Finder to front Hide('MACS') or warn $^E; # hide Finder Show('Finder', 1) or warn $^E; # show Finder (1 == use name) DESCRIPTION
Simply launch or quit applications by their creator ID. The Finder can be quit in this way, though it cannot be launched in this way. This module is used by many other modules. This module as written does not work with MacPerls prior to 5.1.4r4. "Hide" and "Show" do not currently work on Mac OS X. Apps that don't have signatures under Mac OS X currently aren't handled, except with LaunchSpecs(). "SetFront" and "IsRunning" can take a four-char creator ID ('MACS'), a bundle ID (''), or a path (/System/Library/CoreServices/ They both optionally take a second parameter which affirms that the data is indeed a path (for those rare cases where a path might possibly look like a creator ID or bundle ID ... you never know). "IsRunning" will return the PSN of the application if it is running, which you can then use for targetting the app, or converting to a PID (with "Mac::Processes::GetProcessPID()"), to send signals to it. EXPORT
Exports functions "QuitApps", "QuitAllApps", and "LaunchApps", "IsRunning", "LaunchSpecs", "SetFront", "Hide", "Show". AUTHOR
Chris Nandor <>, Copyright (c) 1999-2005 Chris Nandor. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2007-01-03 Launch(3)

Check Out this Related Man Page

Processes(3)						User Contributed Perl Documentation					      Processes(3)

Mac::Processes - Macintosh Toolbox Interface to Process Manager SYNOPSIS
use Mac::Processes; while ( ($psn, $psi) = each(%Process) ) { print "$psn ", $psi->processName, " ", $psi->processNumber, " ", $psi->processType, " ", $psi->processSignature, " ", $psi->processSize, " ", $psi->processMode, " ", $psi->processLocation, " ", $psi->processLauncher, " ", $psi->processLaunchDate, " ", $psi->processActiveTime, " ", $psi->processAppSpec, " "; } DESCRIPTION
Access to Inside Macintosh is essential for proper use of these functions. Explanations of terms, processes and procedures are provided there. Any attempt to use these functions without guidance can cause severe errors in your machine, including corruption of data. You have been warned. Constants kNoProcess kSystemProcess kCurrentProcess Special process IDs. launchContinue launchNoFileFlags launchUseMinimum launchDontSwitch launchAllow24Bit launchInhibitDaemon Launch flags. modeDeskAccessory modeMultiLaunch modeNeedSuspendResume modeCanBackground modeDoesActivateOnFGSwitch modeOnlyBackground modeGetFrontClicks modeGetAppDiedMsg mode32BitCompatible modeHighLevelEventAware modeLocalAndRemoteHLEvents modeStationeryAware modeUseTextEditServices modeDisplayManagerAware Mode flags in SIZE resource. LaunchParam This Perl hash maps onto the fields of a Launch Parameter Block. The fields are: launchFileFlags launchControlFlags launchAppSpec launchAvailableSize launchProcessSN launchPreferredSize launchMinimumSize new LaunchParam [ARGUMENTS] Returns LaunchParam. $launch = new LaunchParam(launchAppSpec =E<gt> "hd:apps:myapp", launchMinimumSize => 32000); DESTROY LPB ProcessInfo This Perl hash allows access to the "ProcessInfo" structure. The field names are: processName processNumber processType processSignature processSize processMode processLocation processLauncher processLaunchDate processActiveTime processAppSpec DESTROY PI Functions LaunchApplication LAUNCHPARAMS The LaunchApplication function launches the application from the specified file and returns the process serial number if the application is successfully launched. Returns undef on failure. LaunchDeskAccessory PFILESPEC, PDANAME Mac OS only. The LaunchDeskAccessory function searches the resource fork of the file specified by the pFileSpec parameter for the desk accessory with the 'DRVR' resource name specified in the pDAName parameter. If the 'DRVR' resource name is found, LaunchDeskAccessory launches the corresponding desk accessory. If the desk accessory is already open, it is brought to the front. Returns zero on failure. GetCurrentProcess The GetCurrentProcess function returns the process serial number of the process that is currently running, that is, the one currently accessing the CPU. Return "undef" if an error was detected. GetFrontProcess The GetFrontProcess function returns the process serial number of the process running in the foreground. Return "undef" if an error was detected. GetNextProcess PSN Get information about the next process, if any, in the Process ManagerO~s internal list of open processes. Return "undef" if an error was detected. GetProcessInformation PSN The GetProcessInformation function returns, in a process information record, information about the specified process. The information returned in the info parameter includes the applicationO~s name as it appears in the Application menu, the type and signature of the application, the address of the application partition, the number of bytes in the application partition, the number of free bytes in the application heap, the application that launched the application, the time at which the application was launched, and the location of the application file. Return "undef" if an error was detected. SetFrontProcess PSN The SetFrontProcess function schedules the specified process to move to the foreground. The specified process moves to the foreground after the current foreground process makes a subsequent call to WaitNextEvent or EventAvail. Returns zero on failure. WakeUpProcess PSN The WakeUpProcess function makes a process suspended by WaitNextEvent() eligible to receive CPU time. A process is suspended when the value of the sleep parameter in the WaitNextEvent() function is not 0 and no events for that process are pending in the event queue. This process remains suspended until the time specified in the sleep parameter expires or an event becomes available for that process. You can use WakeUpProcess to make the process eligible for execution before the time specified in the sleep parameter expires. Returns zero on failure. SameProcess PSN1, PSN2 The SameProcess function compares two process serial numbers and determines whether they refer to the same process. Return "undef" if an error was detected. ExitToShell This function is not implemented: ExitToShell() unsupported. Use exit. GetProcessPID(PSN) Mac OS X only. Get the UNIX process ID corresponding to a process serial number. GetProcessForPID(PID) Mac OS X only. Get the process serial number corresponding to a UNIX process ID. LSFindApplicationForInfo(creator, bundleID=NULL, name=NULL) Mac OS X only. Return the path to the application matching one or more of creator, bundleID, and name. Pass undef or empty string for unused parameters. $path = LSFindApplicationForInfo("R*ch"); $path = LSFindApplicationForInfo(undef, "com.barebones.bbedit"); $path = LSFindApplicationForInfo(undef, undef, ""); $path = LSFindApplicationForInfo("R*ch", "com.barebones.bbedit", ""); AUTHOR
Written by Matthias Ulrich Neeracher <>, documentation by Bob Dalgleish <>. Currently maintained by Chris Nandor <>. POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 176: Non-ASCII character seen before =encoding in 'ManagerO~s'. Assuming ISO8859-1 perl v5.18.2 2017-10-06 Processes(3)
Man Page