Launching RD3 with Applescript causes it to forget passwords
If RD3 is not running and is asked to execute a script like:
tell application "Remote Desktop" to control (every computer whose name is "TestMachine")
It will present a "Do you want to ask permission to control?" dialog.
In that session, all the computers will have their status as "No User Name and Password" as well.
If RD was already running it works fine. Is there a workaround to this bug?
You might try something like this. This will launch the application and give it a chance to "start up" before issuing the control command.
tell application "Remote Desktop"
activate
delay 3
control (every computer whose name is "TestMachine")
end tell
Similar Messages
-
Launching terminal with applescript
I just recently ventured into the world of MAC, and I am trying to create an applescript (APS) to do the following
1. Launch Terminal
2. make terminal a X11 emulator ("/usr/bin/open-x11")
3. source blah1.sh ("source blah.sh")
4. source blah2.sh ("source blah.sh")
5. chage dir to foo1 ("cd foo1")
6. Leave window open
i have a good idea on how to use APS tolaunch terminal, but I am not sure if it is reading the source file, because it does not chage directory. Could someone help with an example script.
Thanks
MacBook Mac OS X (10.4.8)Hi Lanre,
try this
tell application "Terminal" to run
do shell script "/usr/bin/open-x11 ; source blah.sh ; source blah2.sh ; cd foo1"
or you can make a .term file (search google for how to) -
Launching apps with Applescript
I'm like a drunk driver wheb it comes to Applescript.
I use Final Cut Pro to edit video and have a time tracker program to keep track of the time I spend editing. Is there an Applescript that will launch the time program when I launch Final Cut Pro?
thanks for the help.I am a bit crippled at the moment when writing scripts as my mac is currently in for repairs, so am using my parents windows pc.
I believe there are a number of ways of attacking this problem. Either have a small program always open checking for final cut launch or have a small application that launches both your time tracking program and final cut.
i prefer the second method as it free up systems resources (not much but i always prefer having as little open as possible in regards to background processes). SO i would use something like this:
tell application "Time Tracker"
activate
tell application "Final Cut Pro"
activate
end
end.
I would save it as an application named so it where final cut pro is, and then always use this applciation to launch final cut pro.
However if you launch final cut another way, for example open up a document file that launches final cut pro then this method will not work and the first method described would be a better way of achieveing this. However i am at best a confident novice in regards to applescript and being hindered by not having my mac to try it out on, i can only give pointers.
I believe this will check every 5 seconds for an instance of final cut pro. You can make the time intveral shorter or longer if you wish. I think the option you want to save it as is called "always open" and then in system preferences - accounts - login items select the script.
if process "Final Cut Pro" exsists then
activate application "Time Tracker"
delay 5
end
As i said before this may not work correctly and can only check when my iMac comes back from being repaired (new screen, logic board and psu, so basically replaced but inside the same case). I am sure someone else will step in and offer help in the mean time if i have got something wrong. -
Trying to launch modal window in safari with Applescript
Hello,
I am writing a web-based app that needs to launch a modal browser window from an applescript file. No addressbar, no toolbar, etc. (the pc side uses a .vbs file to do the same thing.) It's like a popup, but this is from my app. Im not launching it from another web page.
I can do it with applescript and "System Events" :
tell application "Safari"
activate
make new document with properties {URL:"http://IPADDRESS/default.aspx"}
do JavaScript ("self.resizeTo(500,480);") in document 1
tell application "System Events"
keystroke "B" using {command down, shift down}
keystroke "/" using command down
keystroke "|" using command down
end tell
end tell
But this affects the entire Safari application so new windows opened by the user appear the same way. I need it to only affect the window that is opened. I tried some JS "toolbar=no" type commands but it did not have any effect. I must admit my JS and AS is very basic at this point so it could have been poor syntax..
Can any of you fine folks suggest a way to do this?It's not what you want to hear, I'm afraid, but as far as I know there's no way to directly access placeholders other than the title and body in Keynote.
I did see mention of parsing XML to change values of individual items, but it might be overkill for what you want to achieve.
Perhaps if you explain what you are trying to do someone will come up with a helpful suggestion. -
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 -
Create iCal-iCloud calendar with applescript
I am trying trying to create a new calendar with Applescript in my iCloud account. I've tried using the following:
tell application "iCal"
make new calendar with properties {title:item i of NewCalendars}
end tell
but it creates it On My Mac. I've tried searching for a way to do this but can't find anything.That seems to be possible with GUI Scripting:
set theTitle to "New calendar"
tell application "Calendar" to activate
tell application "System Events" to tell process "Calendar"
tell menu bar item "File" of menu bar 1
click menu item "iCloud" of menu 1 of menu item "New Calendar " of menu 1
-- (don't remove the space at the end of "New Calendar ")
end tell
keystroke theTitle & return
end tell
Before running the script, don't forget to enable access for assistive devices in the Accessibility System Preference pane. -
How to detect beep sounds with AppleScript?
I have a small dilema.
I created a script that I know generates the standard mac error sound a.k.a. beep sound. I want to detect cases where it does not generate. IS there any way to verify with applescript if the beep sound plays at all?
I mean I hear it, but I want it logged as beep sound played/not played.
any ideas are welcome!You need to generalize the problem to how do you detect an error in another application.
Typically, aplications will return an error code when they find an error. This will cause an excpetion in your applescript app. To detect the error you put the call in a try block.
So what program are you calling?
Did you wrie the other app? If so, return a non-zero error code.
Robert -
I have been unable to log in to iCloud on my iMac. None of the hints online have worked. I can't sign in (with any password), sign out, the forget password doesn't work, the support button doesn't work. It's locked. I can't find anyway to fix this - I need to add a new printer ASAP - help!!!
The "Mail, Contacts & Calendars" window popped up a couple of weeks ago and is asking for my Apple ID password, which it will not accept, It won't sign me out (I am not logged in), the support or forgot password buttons won't work. With this window stuck open, I cannot access anything on system preferences. I can't find any way to make it go away. I have tried both my current and old Apple ID passwords, tried using FaceTime to login with the newer password, etc.
-
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. -
Adobe Photoshop Elements 13 won't launch email with photos attached, why?
Adobe Photoshop Elements 13 won't launch email with photos attached, why?
Gordon,
Are you trying to use email functionality in Elements Organizer and then witnessing this problem.
If this is the case, I would recommend you to go through this article once and see i it helps:
Elements Organizer Help | Share files and slideshows by email
Thanks,
Anwesha -
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. -
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
Maybe you are looking for
-
How do I import my addresses from Outlook-saved on USB drive?
just got an imac, and LOVE it, but am a bit lost! I saved my address book from my old computer ( outlook) onto a USB jumpdrive thinking it would make it super easy to import them into mail, but can't make it do it now...it tells me they're not in the
-
Problem on delete statement in JSP
org.apache.jasper.JasperException: An exception occurred processing JSP page /proj/AdminLog.jsp at line 130 127: Driver Driverrs3 = (Driver)Class.forName(MM_Conn_DRIVER).newInstance(); 128: Connection Connrs3 = DriverManager.getConnection(MM_Conn_STR
-
Advantages of third party Document Management vs SAP
We have had the IXOS product installed for a long period of time to store our SAP related documents such as drawings, POs, Invoices. We also use IXOS to store our SAP archived data thru the SAP archivelink interface. Due to cost and support issues,
-
Same line Item but two differentreceiving IDOCS
Folks I am new to SAP PI and seeking your help in the following scenario legacy -> SAP PI -> branched to two idocs in ECC The scenario is that a fixed length flat file coming from Legacy wil contain some line items but each line will be a separate i
-
Restore database to another host - I have only rman backup files
Hi all, The PC where Oracle was installed is crashed. I have only the RMAN backup pieces in other computer. I want to restore/recover this RMAN backup to other PC. I know the commands, restore database, recover database, but I've always used these co