applescript-objc

convert image to .icns file AppleScript Obj-C

做~自己de王妃 提交于 2019-12-10 12:23:49
问题 how can I convert a .png image to a .icns using applescript? Any help would be greatly appreciated. 回答1: Could you just use sips? sips -s format icns test.png -o test.icns It doesn't seem to support 1024 x 1024 images or create smaller versions though. 来源: https://stackoverflow.com/questions/11991645/convert-image-to-icns-file-applescript-obj-c

Is there a way to package bash shell scripts with AppleScriptObjC app on MacOSX with Xcode?

梦想与她 提交于 2019-12-09 14:03:35
问题 I am trying to automate three or four bash shell scripts using AppleScriptObjC as a wrapper. This will give me a friendly gui front end to select data files etc., and the convenient text file manipulating and processing of several bash scripts. Everything works (I can press my buttons and run the shell scripts) except I can't figure out how to make things semi-portable. I would like to have a single app or package that I could distribute to others, with the needed script files somehow

Change Applescript into single line NSApplescript source

。_饼干妹妹 提交于 2019-12-08 02:14:28
问题 Im building an app for learning purposes of using applescript to send multiple commands during an action. Below is the code I'm messing with but I have stripped out the actions in between the "" and replaced them with numbers. Everything works fine in applescript but making this into an NSApplescript initwithsource: line has been a bother. tell application "Terminal" activate set currentTab to do script "1" do script "2" in currentTab do script "3" in currentTab do script "4" in currentTab

Cocoa Scripting: Accept and return NSData

吃可爱长大的小学妹 提交于 2019-12-07 11:30:27
问题 In order to support binary data exchange in my scriptable Mac app, I like to make it possible to receive and deliver data as NSData, using the AS-ObjC bridge, if that's possible. For instance, I like to make this code possible in AppleScript: use framework "Foundation" set theData to current application's NSData's dataWithContentsOfFile:"/some/binary/file" tell application "MyApp" set raw value to theData end tell The sdef contains a value-type and property for this: <suite name="My Suite"

How to access from AppleScript a bundled file within a Cocoa-AppleScript Application?

梦想的初衷 提交于 2019-12-06 16:04:40
问题 In AppleScript I'm used to call: set audio_file to (path to me as string) & "Contents:Resources:Audio:Music.mp3" display dialog "Path: " & (quoted form of POSIX path of audio_file) I have now this code inside a Cocoa-AppleScript project in Xcode. It compiles well, but the script is not running at all. The dialog never shows. Without the (path to me as string) it works, but without the path. 回答1: For resource file I use: set fname to POSIX path of (path to resource "filename") 回答2: "Path to me

Change Applescript into single line NSApplescript source

℡╲_俬逩灬. 提交于 2019-12-06 10:36:27
Im building an app for learning purposes of using applescript to send multiple commands during an action. Below is the code I'm messing with but I have stripped out the actions in between the "" and replaced them with numbers. Everything works fine in applescript but making this into an NSApplescript initwithsource: line has been a bother. tell application "Terminal" activate set currentTab to do script "1" do script "2" in currentTab do script "3" in currentTab do script "4" in currentTab delay 0.5 tell application "Finder" to set visible of process "Terminal" to false end tell What is the

Cocoa Scripting: Accept and return NSData

流过昼夜 提交于 2019-12-05 15:04:58
In order to support binary data exchange in my scriptable Mac app, I like to make it possible to receive and deliver data as NSData, using the AS-ObjC bridge, if that's possible. For instance, I like to make this code possible in AppleScript: use framework "Foundation" set theData to current application's NSData's dataWithContentsOfFile:"/some/binary/file" tell application "MyApp" set raw value to theData end tell The sdef contains a value-type and property for this: <suite name="My Suite" code="Demo"> <value-type name="ObjCNSData" code="NSDa"> <cocoa class="NSData"/> </value-type> <class name

How to access from AppleScript a bundled file within a Cocoa-AppleScript Application?

穿精又带淫゛_ 提交于 2019-12-04 21:33:51
In AppleScript I'm used to call: set audio_file to (path to me as string) & "Contents:Resources:Audio:Music.mp3" display dialog "Path: " & (quoted form of POSIX path of audio_file) I have now this code inside a Cocoa-AppleScript project in Xcode. It compiles well, but the script is not running at all. The dialog never shows. Without the (path to me as string) it works, but without the path. For resource file I use: set fname to POSIX path of (path to resource "filename") "Path to me as string" seems correct but you could have 2 other problems. 1) the path to your audio file should contain

Click menu item on Mac OSX Lion using AppleScript

别说谁变了你拦得住时间么 提交于 2019-12-04 12:04:27
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" tell process "Terminal" click menu item "New Window" of menu "Shell" of menu bar 1 tell application

Is there a way to package bash shell scripts with AppleScriptObjC app on MacOSX with Xcode?

拈花ヽ惹草 提交于 2019-12-03 20:33:35
I am trying to automate three or four bash shell scripts using AppleScriptObjC as a wrapper. This will give me a friendly gui front end to select data files etc., and the convenient text file manipulating and processing of several bash scripts. Everything works (I can press my buttons and run the shell scripts) except I can't figure out how to make things semi-portable. I would like to have a single app or package that I could distribute to others, with the needed script files somehow incorporated or generated by the app, rather than exposed to the users. I am a noob to Xcode and