Keyboard macros with Applescript
Hello - I am new to PP from FCP 7 and I am trying to set up some new workflows that should really save some time. I am also very new to Keyboard macros with Applescript - but I love the concept and almost everything I have tried has worked so far - with one exception - and I can't figure it out for the life of me figure it out
So here is what I would like to do:
I want to cut out clips from interviews and make subclips. I need to keep a visual record of what I pulled and from where.
Here is how I do it:
I lay out all synced audio and video of interviews in a timeline sequence. I go allong and find the in point of a clip i'd like to create a subclip of, and I hit command+k to cut all active tracks. I then find my out point of said clip and hit command+k again. I select the clip and hit option+ up arrow (NOTE - i have the layers set in a way that this clearly differentiates the clip I've pulled and it works by haveing go up from track 1 to 2 and audio up from track 2 to 1). I then create a subclip of that clip with a keyboard shortcut I have set up as control+d. Then back to searching for the next clip.
How I would like to do it with keyboard automation via applescript:
Find the clip and command+k "cut" the in point and put the playhead at the out point and run the following script:
tell application "Adobe Premiere Pro CC"
activate
end tell
tell application "System Events"
keystroke "k" using {command down} # my 2nd "out" blade cut for the clip i want
delay 0.2
key code 126 # (up arrow) send playhead back to the start of the clip
delay 0.2
keystroke "d" # selects the clip at playhead
delay 0.2
key code "126" using {option down} #NOT WORKING - (option+up arrow) to shift my clip up 1 layer
delay 0.2
keystroke "d" using {control down} # shortcut i created to make subclip
delay 0.2
key code 36 # (return key) approves defalt subclip settings
delay 0.2
key code 20 using {shift down} # (Shift+3) selects timeline pannel
delay 0.2
key code 125 # (arrow up) goes to next cut
end tell
So - as you can see - the one thing I can not get to work is any key command to shift a clip up in the timeline. What is really bizzare is that even if I change the keyboard short cut from "option+up arrow" to anythiing else, apple scrip will just not exicute that command. The correct pannel is selected, everything else works, and of couse when I try the actual option+up arrow without involving scrpt at all - it works.
Can anyone who might be a little more firmilliar with scriping macros please take a look at my code and tell me what I might be doing wrong. Thank you!
I think i already found a solution to my problem: Butler.
Sorry for the confusion.
Similar Messages
-
Mouse/Keyboard issues with Mountain Lion
Has anyone had issues with mouse and keyboard functionality with Mountain Lion? I have two iMacs and a Mac Book Pro, but this iMac is the only one I'm having trouble with. First, ML somehow prompted Razer Nostromo drivers to stop functioning(just for macros). I just figured I had to wait until an update was released(which btw hasn't happened yet ) However, I also use the Razer Naga and I don't believe that the Naga is the culprit, but I could be wrong. For the past week or so when I single click, it registers as as a double-click. It is SO annoying. Has anyone experienced this? I have gone over all mouse and accessibility settings and nothing helps. I have downloaded the updated drivers and nothing works.
Thanks in advance for all responses,
AshleyI didn't think of doing that, but I tried it and the problem does not occur when the right mouse button is primary. However, when I switched it back to make the left button primary, the problem returned. Would this indicate that it is a hardware problem or could it implicate the drivers as well? I suppose the mouse would make sense since I do not use this mouse on my other two items with Mac OS X. What do you think?
Thanks,
Ashley -
Can not add function to pages-document created with Applescript
If I create new document using the GUI (New document) I can place the cursor within any table-cell, type "=" (equal sign) and f.e. "2+2" which will result in a cell showing a "4".
If I create a document with Applescript, I can not add new functions (neither by typing = nor by using Insert >> Function (may be different, I have German version here). Already existing functions (which already were in the template) can still be used and work as expected but can not be altered.
Any idea?
I use Pages '08, Version 3.03
Code I used to create the document:
tell application "Pages"
launch
make new document at front with properties {template name:templateName}
# Angebotsnummer ins Dokument schreiben
tell body text of front document
make new paragraph at after paragraph 1 with data angebotsNr
set paragraph style of paragraph 2 to "Überschrift"
end tell
# Datei abspeichern
set dateiName to missing value
repeat until dateiName is not equal to missing value
set dateiName to text returned of (display dialog "Datei Name:" default answer angebotsNr & "_" & kundenName) as text
end repeat
save front document in angebotsOrdner & dateiName
end tellI apologize but the given script can't run.
The variable templateName is undefined.
The variable angebotsNr is undefined too.
About the described behavior, it's a bug which I never discover before.
It's always striking in Pages '09.
Here is the report which I filed :
Bug ID# 8704270
Summary:
+Odd behavior of tables in Pages documents created by a script+
+Steps to Reproduce:+
+Run this huge script+
+tell application "Pages"+
+make new document at front with properties {template name:"Blank"} (* "Vierge" on French systems *)+
+end tell+
+Insert a table+
+try to insert a formula+
+Expected Results:+
+I assumed that I will get the formula editor which I get when the document is created by hand+
+Actual Results:+
+There is no way to get the editor, no way to insert the equal character.+
+This odd behavior strike in all versions of Pages '09 and Pages '08+
Regression:
+None to my knowledge+
Yvan KOENIG (VALLAURIS, France) dimanche 28 novembre 2010 11:30:29 -
Automated report/ PDF conversion with AppleScript
Hello-
I am attempting to PDF a spreadsheet from Dropbox, and email it to a set list of recipients with AppleScript. Much of this I have been able to figure out, but I am having some issues with the PDF conversion. As you can see below, I am still working on sending the xls file, and have not yet been able to get AppleScript to convert a specific tab of the file to aPDF. I expect scheduling to be handled theough crontab.
Current script is as follows:
tell application "Finder"
set folderPath to folder "Macintosh HD:Users:user:Dropbox:folder:Calculated PO Sheet"
set theFile to first file in folderPath as alias
set fileName to name of theFile
end tell
set theSubject to "Current PO Report" date
set theBody to "See attached."
set theAddress to "recipient email"
set theAttachment to "CALCULATED PO SHEET.xlsx"
set theSender to "sender email"
tell application "Mail"
set theNewMessage to make new outgoing message with properties{subject:theSubject, content:theBody & return & return, visible:true}
tell theNewMessage
set visibile to true
set sender to theSender
make new to recipient at end of to recipients with properties {address:theAddress}
try
make new attachment with properties {file name:theAttachment} at after the last word ofthe last paragraph
set message_attachment to 0
on error errmess -- oops
log errmess -- log the error
set message_attachment to 1
end try
log "message_attachment = " & message_attachment
#send
end tell
end tellHi,
there is a special setup for this requirement. Please see the following support note
Reference
Oracle Reports Output For Indian Languages Like Gujarati, Marathi [ID 980554.1]
Roberto -
Is there a way to edit IPTC data of an image with AppleScript?
Hi,
I'm looking for a way to batch-edit the IPTC data from images. Is that somehow possible with Applescript? If so, could someone point me to a direction?
(I fond a script working wit Graphic Converter in another thread, but that didn't work.)
Thanks,
p.Frank, maybe you could give me a hand here. I'm building the basic script cycling through the dropped files. But I don't know how to best implement the terminal command.
In each cycle, I would set the file path as a variable and then compose the terminal command in order to execute it with "do script".
But "set x to path of eachFile" doesn't work: <<class ppth>> of alias "(path shows here)" could not be read. Any ideas how to do that better?
on open theFiles
repeat with eachFile in theFiles
set x to path of eachFile
tell application "Terminal"
activate
do script "hello" (Exiftool command will be here)
close window 1
end tell
end repeat
end open -
Help with Applescript - filenames
Hi!
I hope there is someone who can help me. I have very little experience with Applescript, and have spent a couple of days scouring these forums amongst others without any luck...
I have a folder (titled XLS) with about 1000 excel files in it. They are numbered basen on some parametric calculations (1111.xls, 1112.xls, 1113.xls, etc). I have constructed an Automator rutine which, one at a time, can open each excel file, copy some cells and then paste the data into an empty xml-file in TextWrangler. The empty xml-file is also in the XLS folder.
What I am looking for is an applescript which can rename the open xml-file with the same filename as the xls-file. So, when 1111.xls is open, the xml-file gets renamed 1111-xml; when 1112.xls is open, the xml-file gets renamed 1112-xml, etc. Each new xlm-file is to be saved into a folder XLM, whivh is also in the XLS folder.
Thanks in advance....
RobSe below; there are two folders on the desktop; "xls" (with xls-files in) and "xml", as well as the empty Template.xml file. Here it is!:
--3 XLS to XML
tell application "Finder"
set fileList to every file of entire contents of ("YourHD:Users:You:Desktop:xls" as alias)
end tell
repeat with i from 1 to number of items in fileList
set currentFile to (item i of fileList)
tell application "Microsoft Excel"
set screen updating to false
open currentFile
activate currentFile
activate object worksheet 1
copy range range ("YourRange")
end tell
tell application "Finder"
copy file "YourHD:Users:You:Desktop:Template.xml" to folder "YourHD:Users:You:Desktop:xml"
end tell
tell application "Microsoft Excel"
set docName to name of window 1
end tell
tell application "Finder"
set docName2 to text 1 thru ((offset of "." in docName) - 1) of docName
set theFile to "YourHD:Users:You:Desktop:xml:Template.xml" as alias
set the name of theFile to docName2 & ".xml"
open file theFile
end tell
tell application "TextWrangler"
activate
paste
close text document 1 saving yes
end tell
tell application "Microsoft Excel"
activate
close active workbook saving no
end tell
end repeat
tell application "Microsoft Excel"
set screen updating to true
quit
end tell
tell application "TextWrangler"
quit
end tell -
Creating a Save As dialog box with Applescript for Excel 2008
This is going to be part of a larger script. I'm trying to figure out how to make the default save location to where the file opened from and the default file name to the current filename in the dialog box.
Here is what I go so far...
tell application "Microsoft Excel"
tell active workbook
set myFile to choose file name with prompt "Save file as:"
end tell
end tell
I'm very new with working with Applescript, so at this point I have been piecing together code snippets.
Any help would be great and thank youThe choose file name command supports a default location parameter that tells it where to open the dialog:
set myFile to choose file name with prompt "Save file as:" default location (alias "Macintosh HD:Users:username:foldername:")
So you need to look at the Excel dictionary to determine the path to the current file and insert it into the script. Every version of Excel has slightly different dictionaries so the version you're running is critical to getting the right syntax. -
MS-Word Macros with paramers via OLE
Hi,
This is probably more of an MS-Word question than a Forte question,
but somebody out there might have done this before...
I have some MS Word macros (Originally WordBasic, but recently they
underwent automatic conversion to become Visual Basic) which take
parameters.
I used to call these macros from Forte using DDE.
These days, it's a lot more fashionable to use OLE automation than
DDE so I thought I'd give that a go.
But I can't.
Word.Applicaiton has a Run() method to run macros, but not macros
with parameters. Is there a neat way of getting macro parameters
across to Word?
- Ed.
Eduard E Havelaar | For the foolishness of God is wiser
Information Services Section | than man's wisdom, and the weakness
University of Canterbury | of God stronger than man's strength
Christchurch, New Zealand | - I Cor 1:25have a look at this here article:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html -
Export PDF Workflow with Applescript and CS3
Hello,
I am setting up some PDF workflow with Applescript.
On a given moment, as my script runs and after getting some user-input answers to questions in some dialogs, my script tells InDesign CS3 to open the Export Adobe PDF window for the current document. I copied and pasted that small part of the script:
tell application "Adobe InDesign CS3"
tell document 1
export format PDF type to "Macintosh_HD:Test01.pdf" using "somePreset" with showing options
end tell
end tell
When you run this small part of my Applescript, InDesign opens the Export Adobe PDF window (as expected) waiting for me to click on "Export". That is exactly what I want, since the user is given here a last opportunity to change some values (for example page range, or spreads). When all is set, the user can click on Export to close the dialog and finish the script.
Problem: I was hoping that the Adobe PDF Preset "somePreset" would be selected in the first pull-down menu of the Export Adobe PDF window when this window is opened by the script. Unfortunately the last used preset is always selected by default. Anyone suggestions or help?
Kind regards,
Bertus Bolknak.My operators enter the page range and filename into a dialog box. Then I set those in the script. I use the Press Quality preset to start with and then set the changes I want into a export variable. I set things like bleed, marks, page range, etc.
Here is an example:
set theProps to properties of PDF export preset "[Press Quality]"
try
delete PDF export preset "Schmidt PDF"
end try
set theStyle to {name:"Schmidt PDF", acrobat compatibility:acrobat 7, bleed top:"0.125i", bleed bottom:"0.125i", bleed inside:"0.125i", bleed outside:"0.125i", page marks offset:"0.125i", include ICC profiles:Include None, effective PDF destination profile:use no profile, effective PDF X profile:"No Color Conversion"} & theProps
make PDF export preset with properties theStyle
set properties of PDF export preferences to theStyle
set color bitmap sampling of PDF export preferences to none
set grayscale bitmap sampling of PDF export preferences to none
set page range of PDF export preferences to (item i of myPageList) as string
export document 1 format PDF type to (PrinergyFolder & myJobNumFinal & "_" & VerCode & ".pdf") as Unicode text without showing options
I am also doing this in Quark. -
How to use a macro with AAA Authorization set?
So!
We have ACS version 4.1, and one goal is to start working on authorization sets for groups. I am able to get basic commands to work, but was curious about making a macro work without having to allow all of the commands that are actually contained wihtin the macro itself.
I'm looking into this to promote standardization and minimize confiugration issues/inconsistencies on ports accross swtiches in our environment.
The macro I created is used for configuring a port on a swtich to change its VLAN. Basically as follows:
macro name T2
Description $DESC
switchport mode access
no cdp enable
switchport access vlan $STATIC
switchport port-security
switchport port-security aging time 2
switchport port-security violation restrict
switchport port-security aging type inactivity
storm-control broadcast level 25.00
storm-control action trap
switchport nonegotiate
no lldp transmit
no lldp receive
#macro keywords $DESC $STATIC
In ACS I've created a shell command authorization set, and allowed 'macro' with 'permit apply T2' and 'permit trace T2'. This works fine and allows me to use those macro commands. The problem I'm having is that every command in the macro is not allowed in the authorization set, so when I run the macro it fails for each command.
I don't want to allow each individual command in the authorization set as it would then allow jr. admins the ability to make config changes on ports that would be outside of our standard. For example they could get into a port and forget to disable CDP and LLDP, casuing inconsistencies accross the envrionment. Is there a way to run these macros without putting all of the commands in the authorization set?Hello Eric,
Please see the below link for configuring Macro and how you can use them with AAA
http://www.cisco.com/en/US/docs/switches/lan/auto_smartports/12.2_55_se/configuration/guide/configure.html -
Create Smart Folder with Applescript?
Hi
Is there a way to create a Smart Folder with Applescript?
many thanks
LJthanks neil.
one other question. once i've made this folder i'll want to use it.
it occurs to me that i might not be able to use the same code to
call the folder after it's been created since, while the date may
be the same, the time won't be.
how do i stored the new folder name as it's being created so that
i can call it later in the script?
thanks again,
BabaG -
I can't seem to "close" my documents on MSoft Word with AppleScript!
Hi
I have tons of documents open on MSoft Word and wish to close some of them. Luckily, those that I wish to close all start with the word "book", so I was thinking I could actually automate that with AppleScript hence avoid closing them one by one.
I wrote the following code:
tell application "Microsoft Word"
count (document)
set countresult to result
repeat with incrementValue from 1 to countresult
if name of document incrementValue starts with "book" then
activate document
close document
end if
end repeat
end tell
To my surprise, it didn't work!
I got the following under "Replies", which showed that AppleScript did indeed try to close the document that starts with "book":
tell application "Microsoft Word"
count every document of current application
--> 6
get name of document 1
--> "book_mac_OS_X_and_iOS_internals.htm"
activate
close document
get name of document 2
--> "applicable books.htm"
get name of document 3
--> "What Do You Want Homespace to Do.htm"
get name of document 4
--> "URL_repository_for_outcomes.htm"
get name of document 5
--> "SYNTHESIS - History a Step Back.docx"
get name of document 6
--> "SYNTHESIS - History a Step Back.docx"
end tell
But when I went back to Word, I still saw the document there!
I actually added an additional line (I didn't include the code in that which I pasted here) asking to count the number of documents in Word AFTER the so-called "close", and the number remains 6.
Can anyone enlighten me on this?
Regards,
junxiang99Hi,
The quickest way to do this (tested with OS 10.8.2, MS Word 2011) is in one line:
tell application "Microsoft Word" to close every document whose name begins with "book"
The reason why your script doesn't work is that you aren't specifying to Word which document you want it to close.
So, changing one line ought to do it:
close document incrementvalue -- instead of "close document"
But... when you close a document, you change the document count. Document 2 becomes document 1, document 3 becomes document 2 etc. So eventually you'd get a message saying "The object you are trying to access doesn't exist".
Because of this, if you want to do it in a repeat loop, you have to work backwards:
tell application "Microsoft Word"
set doc_count to count documents
repeat with x from doc_count to 1 by -1
if name of document x begins with "book" then close document x
end repeat
end tell
Hope this helps. -
Keyboard problems with Enter, delete, backspace, and right/left arrows
In some applications, such as Yahoo and this message block right now !!, when composing a message, the arrow keys and delete, backspace keys become non responsive. Various ones will work on a random basis.
I am getting double "carriage returns" also. Maybe this is why in Omegle when I press ENTER, it will not post a chat message; it will bring up a scroll box and for me to post the comment, I have to use the mouse to click ENTER.
I have changed batteries in my keyboard, uninstalled /reinstalled Firefox. I have checked the above websites in Chrome and other browsers, and there are no problems.
This has happened before, I don't recall what the solution was or if it just went away.'''
Affected sites -- at least these
http://us.mg6.mail.yahoo.com/neo/launch?ncrumb=Fx5R4O7ccqb&.rand=1041364415&nmig=yes#
http://omegle.com/
https://support.mozilla.com/en-US/questions/new?product=beta&category=b2&search=Keyboard+problems+with+Enter%2C+delete%2C+backspace%2C+and+right%2Fleft+arrows&showform=1PROBLEM SOLVED: http://forum.archlinux-br.org/viewtopic.php?id=1257
Solution posted on Brazilian Archlinux forum. Credits to user "920608".
[cache]
/etc/xorg.conf
Section "Files"
#RgbPath "/usr/X11R6/lib/X11/rgb"
EndSection
Section "ServerFlags"
Option "AutoAddDevices" "False"
EndSection
C'ya -
Is the ZAGG keys Universal Keyboard compatible with Apple TV?
is the ZAGG keys Universal Keyboard compatible with Apple TV?
The ZAGG keys Universal Keyboard is a Bluetooth keyboard that the manufacturer states is "compatible with most IOS devices" but does not list Apple TV specifically, though the the different IPADS that are compatible are listed.
I did contact the manufacturer through an online Sales Associate Chat on their website and ironically they could not answer me. They did take my email and stated they will research and get back to me. That was only yesterday, 10/7/13 so I will give it a few days.
I know there are other keyboards available, so maybe I will just research a little more. -
Edit Illustrator symbol with AppleScript
Hello,
Does anyone know if it is possible to edit an existing symbol in an Illustrator CS3 document with AppleScript? Specifically, what I'm trying to do is this: I'd like to manually create an Illustrator document that uses the "3D Extrude and Bevel" effect to map symbols to the surfaces of the 3D object. Then, I'd like to programatically open that Illustrator document, edit the existing symbols (so the surfaces of the 3D object are updated), and finally export an image.
From what I've found in the AppleScript documentation PDF, I'm thinking this is not possible since it lists all the properties of a symbol object as read-only. But perhaps I'm overlooking something?
If it is not possible, is there another way of doing what I'm trying to achieve?
Thanks!
BenBen, could you not have just swapped your symbols? like:
set symbol of every symbol item to symbol "Foo"
Justin, if it is essential that you need to crack open a symbol item then it may be possible using system events to expand the item may even be possible with a action for this part?
This works for me. It is set to work with what items i know are available to my test doc.
{1 symbol of >2 path items, 2 gradients swatches}
tell application "Adobe Illustrator"
activate
set Doc_Ref to the current document
tell Doc_Ref
set x to width / 2
set y to height / 2
set ruler origin to {x, y}
-- Make new layer to trash later
make new layer at beginning with properties ¬
{name:"Opened Symbol", visible:true}
-- Place the symbol item you want to open
make new symbol item at beginning of layer "Opened Symbol" with properties ¬
{symbol:symbol 1, position:{0, 0}}
-- Select the item
set selection to symbol item 1
-- Use system events to drive the GUI
tell application "System Events"
tell process "Adobe Illustrator"
tell menu bar 1
click menu item "Expand..." of menu "Object"
delay 0.1
keystroke return
delay 0.1
click menu item "Ungroup" of menu "Object"
end tell
end tell
end tell
-- List your items to edit
set Symbol_Items to every page item of layer "Opened Symbol"
-- Edit what ever you have here
set fill color of path item 1 of layer "Opened Symbol" to {gradient:gradient 1}
set fill color of path item 2 of layer "Opened Symbol" to {gradient:gradient 2}
-- New group
set New_Group to make new group item at beginning of layer "Opened Symbol"
-- Move edited items into new group
repeat with i from (count of Symbol_Items) to 1 by -1
move (item i of Symbol_Items) to beginning of New_Group
end repeat
-- New symbol from group
make new symbol at end with properties ¬
{name:"My New Symbol", source art:New_Group}
-- Replace instances
set symbol of every symbol item to symbol "My New Symbol"
-- Clean up
delete every page item of layer "Opened Symbol"
delete layer named "Opened Symbol"
delete symbol 1
end tell
end tell
Maybe you are looking for
-
Blackberry Curve 8320 Smartphone - Recording Videos
HELP! I can't for the life of me figure out how to record a video with my Blackberry Curve 8320 Smartphone. Thanks!
-
Here is my problem: When I plug my iPod into the USB, a message comes up that indicates that "iTunes cannot read the contents of (My Name)'s iPod." The message advises that I should "go to the summary tab in iPod preferences and click restore to rest
-
My iphone 4s cant activate after i update the ios to 6.0.1, always shows this message " Your request couldn't be processed" we are sorry but there was an error processing your request, Please try again later........please someone help me???
-
How long should clean up take or format on zen mi
hi another question i know im getting on everyones nevres now cause i ask so many questions but does anyone know how long does clean up or format take because i dont know if mine is taking ages or has frozen please help gill
-
My PowerBook G4 won't connect to the internet
I bought it at a garage sale a while back. I rebooted the whole system so I was able to have my own account. AirPort is turned on but is not connected to a network. When I typed in my password when I was putting all my information in on the SetUp scr