-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add several schemes for launching an app.
- Loading branch information
BarkyTheDog
committed
Jan 11, 2015
1 parent
78bc66e
commit 2642d2d
Showing
8 changed files
with
318 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tell application "TextEdit" to runtell application "TextEdit" to activate | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
on launch_app(user_message) | ||
tell application user_message to run | ||
tell application user_message to activate | ||
end launch_app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tell application "TextEdit" to runtell application "TextEdit" to activate | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// LaunchWithSystemCall.cpp | ||
// LauncherApp | ||
// | ||
// Created by Philip Schneider on 1/10/15. | ||
// Copyright (c) 2015 Code From Above, LLC. All rights reserved. | ||
// | ||
|
||
#include "LaunchWithSystemCall.h" | ||
#include <stdlib.h> | ||
|
||
void launchWithSystemCall(const char * const app) | ||
{ | ||
if (!app) | ||
return; | ||
|
||
char scriptCode[256]; | ||
sprintf(scriptCode, "tell application \\\"%s\\\" to run\n\ | ||
tell application \\\"%s\\\" to activate", | ||
app, app); | ||
|
||
char commandLine[256]; | ||
sprintf(commandLine, "osascript -e \"%s\"", scriptCode); | ||
|
||
int result = system(commandLine); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// LaunchWithSystemCall.h | ||
// LauncherApp | ||
// | ||
// Created by Philip Schneider on 1/10/15. | ||
// Copyright (c) 2015 Code From Above, LLC. All rights reserved. | ||
// | ||
|
||
#ifndef __LauncherApp__LaunchWithSystemCall__ | ||
#define __LauncherApp__LaunchWithSystemCall__ | ||
|
||
#include <stdio.h> | ||
|
||
void launchWithSystemCall(const char * const app); | ||
|
||
#endif /* defined(__LauncherApp__LaunchWithSystemCall__) */ |
Oops, something went wrong.