applescript-objc

Progress Bar with Applescript

纵然是瞬间 提交于 2021-02-11 15:48:36
问题 Is there any way to make a progress bar that is loading as a shell script or shell command runs? I currently use the following: property theWindow : missing value property parent : class "NSObject" property customView : missing value property myProgressBar : missing value on hardwareData() set alert to current application's NSAlert's alloc's init() tell alert its setAccessoryView:customView its setMessageText:"Loading Informations" its setInformativeText: "Please Wait..." its setAlertStyle:1

AppleScript Application is not allowed to send keystrokes

感情迁移 提交于 2020-12-29 10:55:23
问题 I made an app with AppleScript called FRIDAY. When I tell it to 'open chrome', it opens google chrome, this is working on Script Editor and out side of script editor. I can also tell it to 'open a new tab' and it opens a new tab using keystrokes: -- this boolean is the reason this script keeps runing set condition to false say "Welcome sir" set commands to {"what is todays date", "what time is it", "what is the time", "what day is it", "what month is it", "which month is it", "friday you up",

How to relaunch the moved application to a new location?

狂风中的少年 提交于 2020-06-01 06:41:07
问题 I'm trying to simulate what Lets Move does, that is, when the user runs the application he checks to see if the application is running from within the Applications folder if he is not, he displays an alert asking the user to copy the application for applications folder, if he clicks on the button "Move to Applications Folder" he moves the application but I can't relaunch the application from the new location. I would like to know how to do this, thanks in advance. on moveMyApp() set checkpath

Apple Script working fine but with Objective C Library not getting expected out put

浪尽此生 提交于 2020-01-09 08:17:06
问题 I tried running apple script #! /usr/bin/osascript do shell script "chmod 777 /Library/ColorSync/Profiles" with administrator privileges It perfectly working in script editor and terminal. But not able to run with Objective C. Any help will be appreciated. -(void)executeAppleScript{ NSDictionary* errorDict; NSAppleEventDescriptor* returnDescriptor = NULL; NSAppleScript* scriptObject = [[NSAppleScript alloc] initWithSource: @"#! /usr/bin/osascript do shell script \"chmod 777 /Library/ColorSync

Click menu item on Mac OSX Lion using AppleScript

一个人想着一个人 提交于 2020-01-01 12:14:18
问题 I have a problem using a simple AppleScript on Mac OSX 10.7.3. With the following simple AppleScript which I find everywhere OSX raises an error 'The action "Run AppleScript" encountered an error' I open up the Automator, create a Service, drop in a "Run AppleScript" node and enter the following code which I assume is correct because as I said it is the way a lot of people are doing it without any complaints. AppleScript: tell application "Terminal" to activate tell application "System Events

Click menu item on Mac OSX Lion using AppleScript

[亡魂溺海] 提交于 2020-01-01 12:14:09
问题 I have a problem using a simple AppleScript on Mac OSX 10.7.3. With the following simple AppleScript which I find everywhere OSX raises an error 'The action "Run AppleScript" encountered an error' I open up the Automator, create a Service, drop in a "Run AppleScript" node and enter the following code which I assume is correct because as I said it is the way a lot of people are doing it without any complaints. AppleScript: tell application "Terminal" to activate tell application "System Events

Click menu item on Mac OSX Lion using AppleScript

二次信任 提交于 2020-01-01 12:14:04
问题 I have a problem using a simple AppleScript on Mac OSX 10.7.3. With the following simple AppleScript which I find everywhere OSX raises an error 'The action "Run AppleScript" encountered an error' I open up the Automator, create a Service, drop in a "Run AppleScript" node and enter the following code which I assume is correct because as I said it is the way a lot of people are doing it without any complaints. AppleScript: tell application "Terminal" to activate tell application "System Events

Applescript Syntax (Multiple Args) Inside Objective-C File

谁说我不能喝 提交于 2019-12-25 05:31:39
问题 I have been working on trying to run an Applescript from within Objective-C that queries out to the terminal to run some shell commands. I am running into an issue with how to format the command within Objective-C, so that the script object gets referenced properly. This is what the script looks like as an applescript set thisFile to "Dev1.4" set testTarget to "/Users/lab/Desktop/untitled" do shell script "/Users/lab/Desktop/TempRoot/myCommand.command " & thisFile & space & testTarget with

Embed a bash shell script in an AppleScriptObjC application with Xcode

。_饼干妹妹 提交于 2019-12-23 05:46:27
问题 I have attempted to follow the instructions on this post but I am falling short of understanding how some of the posters instructions work. I want to be able to package the app with a prewritten bash script and then execute it, but don't follow from Step 4 onwards. Post writes: 4. Also in your AppleScriptObjC script, add the following where appropriate: property pathToResources : "NSString" -- works if added before script command 5. Where appropriate, also add the following in your