applescript

Scriptable Application Example

别来无恙 提交于 2019-12-12 02:53:06
问题 Evidently, there's a way to make my GUI application scriptable with AppleScript. So for instance, I could have a command line app (like run from a LaunchDaemon) that tells my GUI app to post a sidebar notification. Does anyone have a simple example to explain this? Everything I've seen on the Apple website is hard to understand. I want to create an AppleScript message like: tell "My App" to notify with title "Title" subtitle "subtitle" text "some text" in my CLI app and then my GUI app wakes

Using an applescript/automator to attach multiple items to a new Outlook message

断了今生、忘了曾经 提交于 2019-12-12 01:38:36
问题 I've worked out (found online) how to attach a single item from Finder to a new Outlook message. I've played with this format a good amount - changed 'selecteditem' and selection and some other more major changes - but I can't work out how to get more than one item to attach to a new outlook message at a time. Only a single item attaches to each new outlook message. There are no Outlook Automator options in Automator - I think Office 365 did away with them. My current script is as follows:

Translate Applescrip [key code 125 using command down] to appscript

孤者浪人 提交于 2019-12-12 01:35:10
问题 how to translate the following Applescript to appscript: tell application "System Events" key code 0 using command down end tell I want to perform "Command + A"-like short cut, i.e., select all texts. 回答1: Look at the application ASTranslate which was installed as part of Appscript. It translates Applescript to Appscript for Python or Ruby. Be aware it just traps Apple Events and thus won't translate Applescript structures like loops or the like. It's very easy to use. Just past your

Applescript, trimmed quicktime video but can't keep file name and save

半世苍凉 提交于 2019-12-12 01:27:27
问题 I have tried for the life of me and I cannot figure out how to maintain the file name and "save as" I have tell application "Quicktime Player" activate trim document 1 from 20 to 50 end tell Any help would be greatly appreciated :-) 回答1: Untested, but you can give this a try. tell application "QuickTime Player" activate tell document 1 trim from 20 to 50 save as file_name end tell end tell Or... close saving yes 来源: https://stackoverflow.com/questions/24255876/applescript-trimmed-quicktime

Change Finder folder background color AppleScript

安稳与你 提交于 2019-12-12 01:27:08
问题 I'm trying to change the background color of Finder within a repeat loop. tell application "Finder" set windowCount to (count windows) if windowCount > 0 then #check if windows are available set bgcolor to {65535, 0, 32896} repeat 10 times tell the icon view options of window 1 set the background color to {some item of bgcolor, some item of bgcolor, some item of bgcolor} delay 0.1 end tell end repeat end if end tell I know I'm missing something simple here. I got it to work in other contexts

How to install and run SIlverlight application through AppleScript?

倖福魔咒の 提交于 2019-12-12 01:23:14
问题 I have a Silverlight application ("file1.xap" - not ".app" it is ".xap"). How do I install and run it using AppleScript on MAC OS X? 回答1: Besides the fact that your applet probably won't have permissions to install anything on Mac OS X 10.7 and later, you should be able to just copy the application package from any location to the applications folder: tell application "Finder" copy file "Your Application Name.app" of disk "Your Application Name" to the application folder of the startup disk

evaluate XPath expression not working for attribute (xml:lang) in indesign

南楼画角 提交于 2019-12-11 23:41:51
问题 I am using Xpath expression in Adobe Indesign, to collect the list of elements. I am using the below code to generate it. tell application "Adobe InDesign CS5.5" set user interaction level of script preferences to never interact tell active document tell XML element 1 set myElement to evaluate XPath expression using "//para" end tell end tell set user interaction level of script preferences to interact with all end tell The above code does not works fine if the element contains "xml:lang"

Extract PresentationNotes from keynote

故事扮演 提交于 2019-12-11 20:36:01
问题 I'm having a hard time extracting presentationNotes from a keynote presentation using JXA (Javascript for osx) I don't want to use applescript. There is way more to this script than extracting notes. It seems rather simple. However when I get the presentationNotes its in an RichText object that doesn't seem to have anyway to get normal text. So I figured I'd open up textEditor and write them out to it. Well I can't figure out how to do that. var app = Application('Keynote') document = app

How to pass data from a FileMaker field to an Applescript

喜欢而已 提交于 2019-12-11 19:39:21
问题 I need to delete a file off of my Cincinnati Laser from FileMaker. It gets it there via a FMScript that export field contents of a container to this location. So I know the file name and the path its all built in a calculation field on that record. But I don't know how to get that info into an Applescript using the FM12 "Perform AppleScript" script step When I hard code the path and file name (Shown Below) it works. set xpath to "Titanium Brain:Users:smartin:Desktop:Laser:1512-clr-c.cnc" tell

Mac to extract HTML from Mail messages

拜拜、爱过 提交于 2019-12-11 19:26:48
问题 I am trying to extract HTML from emails using AppleScript . I came across this StackExchange post -- Mac Automator/Applescript(?) to extract URL's from Mail messages -- which tries to extract URLs from email content. The extraction code is: on run {input, parameters} set mailContentList to {} tell application "Mail" repeat with selectedMail in input set end of mailContentList to content of selectedMail end repeat end tell return mailContentList end run This only extracts the visible content,