Applescript help needed: Trying to recreate this .bat file...
Uh oh, perhaps I put this in the wrong forum:)
http://discussions.apple.com/thread.jspa?threadID=2611596&tstart=0
thanks!!!
Spaces are used to delimit the commands and terms on the command line, so to use something with a space (or other characters special to the shell) you will need to escape it (by using a backslash in front of the character to escape) or put the term in quotes. Also, in order to pass parameters to the executable (I am guessing that you are passing command line parameters to the game)), you will need to use the path to the executable in the application bundle, otherwise it will get launched as a regular application.
I don't know what the name of the executable is, but it should be located in the Contents/MacOS folder in the bundle (right-click the application and choose Show Package Contents) - you can drag file items to the Terminal window to get a properly escaped path. The command in the Terminal (or an AppleScript do shell script command) would look something like:/Applications/Games/Butt/Battlefield 1942 The Road To Rome/Contents/MacOS/theExecutableName +game XPack2or'Applications/Games/Butt/Battlefield 1942 The Road To Rome/Contents/MacOS/theExecutableName' +game XPack2
Similar Messages
-
HELP! trying to save a photoshop file -working with CS5 - getting the message, 'could not save xxx because of a programme error' I have tried changing the file name, no difference. Help. A lot of work I don't want to flush away. Thanks Kevin
You may be running on borrowed time. It sounds like something in your OS file system interface has become corrupted.
But some things to try:
1. Save to another local drive/volume, ESPECIALLY if you're trying to save on a network.
2. Choose Image - Duplicate, then try to save on a local drive/volume as a PSD.
-Noel -
Need help pass in date parameter into bat file.
Is it possible to schedule sql job to execute bat files and pass in date below.
I want to take a system date and pass into the bat file below. A Schedule Job will run on Monday at 9 P.M.
I want to automate this process instead manually enter into the bat file. Is that possible?
Any suggestions is appreciate. SQL 2012
Thank you so much in advance.
SQL Schedule job
DECLARE @sMonday VARCHAR(25) = REPLACE(CONVERT(VARCHAR(10), GETDATE(), 1), '/', '')
SET @sMonday = @sMonday + '_qa48_Clonedb'
SELECT @sMonday
--021315_qa48_Clonedb
DECLARE @sPrevMonday VARCHAR(25) = CAST(REPLACE(CONVERT(CHAR(10), DATEADD(DAY, - (DATEPART(dw, GETDATE() ) - 1), GETDATE() ),1), '/', '') AS CHAR(6))
SET @sPrevMonday= @sPrevMonday + '_qa48_Clonedb'
SELECT @sPrevMonday
--020815_qa48_Clonedb
Result want:
-- Testbatfile.bat
REM 021615_qa48_Clonedb
SET sToday = @sMonday
SET sPreviousWeek = @sPrevMonday
SET sNumOfDay=07
DiskMirror -l snapsrvcfdba n4brec01a -i privkey.ppk "snap rename sql32oltp_repl_dataf sqlsnap__brpRMSDVS050a__recent %sToday% "
DiskMirror -l snapsrvcfdba n4brec01a -i privkey.ppk "snap rename sql32oltp_repl_logf sqlsnap__brpRMSDVS050a__recent %sToday% "
DiskMirror -l snapsrvcfdba l9ABC01d -i privkey.ppk "snap rename sql100oltp_repl_dataf %sPreviousWeek% sqlsnap__ABCPWSCVR050a__%sNumOfDay% "See
https://sharminjahan625.wordpress.com/2013/08/30/384/
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Trying to run a bat file from oracle
I have followed these steps, see bottom for results, everything is valid but the bat file does not run???? PLease need your help. Doug
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "getbatx" AS
class getbatx //class pdfopen
public static void execmd(String c) //main function
try
System.out.println("Executing:" + c);
Runtime.getRuntime().exec("C:\\WINDOWS\\system32
cmd.exe /c "+c);
System.out.println("Executing:" + c + " ...done");
} catch (Exception e) //catch any exceptions here
System.out.println("Error" + e ); //print the error
CREATE OR REPLACE PROCEDURE host_command2 (p_command IN VARCHAR2)
AS LANGUAGE JAVA
NAME 'getbatx.execmd (java.lang.String)';
/Then as sysdba I put in in the following.
exec dbms_java.grant_permission( 'CAPRS', 'SYS:java.io.FilePermission', '<<ALL FILES>>', 'execute' );
EXEC Dbms_Java.Grant_Permission('CAPRS', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
EXEC Dbms_Java.Grant_Permission('CAPRS', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');Then I make the call.
SET SERVEROUTPUT ON SIZE 1000000
CALL DBMS_JAVA.SET_OUTPUT(1000000);
BEGIN
host_command2 (p_command => 'c:\mybook.bat');
END;
/***** I run this, it completes but does not run the bat file and there is no error message
SQL> BEGIN
2 host_command2 (p_command => 'mybook.bat');
3 END;
4 /
Executing:mybook.bat
Executing:mybook.bat ...done
PL/SQL procedure successfully completed.Yes it should open a dos box, but you forgot to add the .bat file witch you like to run: String[] command = {"cmd", "/c", "start", "c:/Batch files/Cardiobackup/cardiobackup_v1.4"}
-
Help needed in executing a remote batch file
I need to execute a batch file which is located on a remote machine through my machine. I have no idea to go about with. Please can someone help me out with can be used to execute the remote bat file. I am at present using Runtime.exec() to execute it on my machine.. But i cant use it to execute teh bat file on teh remote machine.Please help
Below is an example server that would run on the remote host. You can connect to it using telnet from DOS prompt, it takes a Y/N to run your command in the cmd variable. I haven't included code for a client as it's really not needed for the example below.
Change the cmd and port variables to what you need. You may need to setup firewall rules to allow your chosen port.
Once it's running, you can test it by using "telnet localhost 1234" on your machine, localhost would obviously become the remote computer's hostname or IP.
I am incredibly new to Java (using the forums to learn bits), so excuse any bad coding practises, I'm sure people will point them out.
Keep in mind that this is totally insecure, so if you're using it on an untrusted network, you may want to look into encryption and providing some kind of password authentication, that, for the moment is out of my league.
Screenshot here.
import java.io.*;
import java.net.*;
class RemoteServer {
public static int port = 1234; // Port to listen on
public static String cmd = "C:\\Test.bat"; // Command to run
public static void main(String[] args)
System.out.println("Waiting for connection...");
try {
/* If you want the server to run forever, uncomment the while
loop */
// while (true)
startServer();
} catch (IOException e) {
e.printStackTrace();
System.exit(1);
/* Starts the server */
private static void startServer() throws IOException
ServerSocket server = null;
Socket client = null;
String input;
try {
server = new ServerSocket(port);
} catch (IOException e) {
System.err.println("Unable to list on port " + port);
System.exit(1); // Can't listen, nothing else to do
try {
client = server.accept();
System.out.println("Client connected... awaiting Y/N");
} catch (IOException e) {
System.err.println("Unable to accept connection.");
System.exit(1);
PrintWriter out = new PrintWriter(client.getOutputStream(), true);
BufferedReader in = new BufferedReader(new InputStreamReader(
client.getInputStream()));
out.println("You are connected, ready to launch command: <y/n>");
while ((input = in.readLine()) != null)
if (input.equalsIgnoreCase("y"))
Runtime rt = Runtime.getRuntime();
rt.exec(cmd);
out.println("Command executed... disconnecting.");
System.out.println("Command executed... disconnecting client.");
break;
} else if (input.equalsIgnoreCase("n")) {
break;
} else {
out.println("Please enter Y/N.");
out.close();
in.close();
client.close();
server.close();
} -
Enterprising Applescript programmer needed to create a better Find File
This person needs an enterprising Applescript programmer to create a better Find File:
http://discussions.apple.com/thread.jspa?threadID=1861415
to create a better Find File. I know it is possible to create Applescript interfaces to the Terminal. This is why I'm posting here. I wish I had the time to program it myself.I don't know, it almost seems like he needs a completely custom application, in which case the sequence of operations need to be spelled out in fine detail. There are several really good utilities listed in that thread, but each one of them was nitpicked to death. I don't have a problem with Spotlight (or the shell scripts for that matter), so maybe it is just me.
-
Urgent help needed, can I restore N900 Backup file...
i owned a N900 (now sold out)
before selling i took backup of contacts from backup restore option in application section
now i bought a N8 but i m not able to restore my contacts
1. is there any way to restore them in N8?
2. if not, can i convert them in TEXT or any readable format
urgent help needed
thanks in advanceThe backup procedures built into the phone are only designed for restoring to the same phone (ie: in case or data corruption, software update or repair etc.), they can't usually be used to restore to a phone with a different operating system.
You should have backed up with Ovi Suite before selling the N900, that would have been able to restore to the N8. -
Automator/applescript help needed
Basically I want to use automator and/or applescript to create a script that will add my current MAC address to a text file i specify (in the script) and then have a popup to enter a new one that also gets logged in the text file and then it changes to the new one. I need a way to paste the contents of the clipboard in to a terminal command. How can I do that?
Note that Discussions has dedicated AppleScript & UNIX forums in Support > Discussions > Mac OS X Technologies & an Automator one in Support > Discussions > Mac OS X v10.5 Leopard. These would be better places to post if you are looking for detailed help with this.
That said, take a peek at the man page for pbcopy, which provides Terminal access to the Mac clipboard. The "See Also" section has references to developer info for working with the clipboard.
Message was edited by: R C-R -
Hi:
I need a little help with AppleScript.
I created an AppleScript application to copy some files to a LAN disk that I always have mounted. The application works fine, except that it creates some sort of a lock that prevents me from doing other work with the Finder until the copy process is completed.
If anyone has any ideas for disabling this lock, please let me know. I have included the source code of my script below.
Thanks,
-AstraPoint
===== source code =====
with timeout of 1500 seconds
tell application "Finder"
activate
set current_date to (do shell script "date '+%Y-%m-%d at %H-%M-%S'") as string
set name_p to "Personal Data " & current_date & ".dmg"
set name_d to "Documents " & current_date & ".dmg"
(* copy the target files to another local disk - to create an extra backup *)
duplicate file "Personal Data.dmg" of folder "File Backups" of disk "Macintosh HD" to folder "Ad Hoc Backups" of disk "Macintosh HDx" replacing yes
set the name of file "Personal Data.dmg" of folder "Ad Hoc Backups" of disk "Macintosh HDx" to name_p
duplicate file "Documents.dmg" of folder "File Backups" of disk "Macintosh HD" to folder "Ad Hoc Backups" of disk "Macintosh HDx" replacing yes
set the name of file "Documents.dmg" of folder "Ad Hoc Backups" of disk "Macintosh HDx" to name_d
(* mount remote disk/folder using the alias file on our desktop *)
open alias file "disk HD5"
(* copy the target files to a remote disk - to create an extra backup *)
duplicate file name_p of folder "Ad Hoc Backups" of disk "Macintosh HDx" to folder "Bkup" of disk "HD5" replacing yes
duplicate file name_d of folder "Ad Hoc Backups" of disk "Macintosh HDx" to folder "Bkup" of disk "HD5" replacing yes
end tell
end timeoutI can't help you, but I know a man who can....
This question might be better reposted in the Mac OS X Technologies > Apple Script forum
Best wishes
Bob -
I have the dual band 2.4 or 5GHz model AEBS, Belkin powered 4 port hub, Canon IP1600 printer, 40GB & 120 GB HFS+ USB drives. Win 7 64bit & XP machines.
I only 2 weeks ago did the FW upgrade.
With prior to these 2 FW's, i had issues with my printer not printing the whole page, it would always cut mid last line and then freeze. Had to cycle the printer to get the page out. It would not necessarily print the 2nd time either. The HDD's going through a hub worked fine. I updated to 7.4.1 hoping that would fix the printer issue, it did not. I then began getting "disk repair needed" on both HDD's over the next week; culminating upon both HD's going corrupt.
I reformatted both and moved all my music/movies back, and all was good for a week. Then today, turned both drives on at different times, and both need disc repair again.
So i unplugged them and hooked them up to my Linux Mint rig, and there was no apparent corruption, and all the files were playable.
SO I updated to 7.4.2 tonight, and the printer issue is still happening. BUT the 2 HDD are just fine now, after the update....so this leads me to think there was/is an issue with the router? Oh, i tried to directly plug the HDD into the router as well b4 the most recent update but still disc needs repair....of course they have been working fine for the last 2 hours...
Anyone have any ideas? Im ready to pull my hair out...Thanks in advance.
Message was edited by: user2009Hey Chris, thanks for responding, in my above post I mentioned my troubleshooting:
Since updating my iPhone 5S (T-Mobile) to both 8.0.1 and then 8.0.2 I've had more issues than I've ever had with any iOS in the past (with the exception of iPhone 4 running iOS 7, but clearly that is an older phone, not a 1 year old model like the 5S). Have tried resetting, powering off, etc too by the way. -
Help needed trying make thumbnails from large Image Files
I posted this to the Flex message bored, too. I didn't notice
the Actionscript 3.0 until after. Sorry. Anyway, I have some
ActionScript 3.0 code, created with Flex that will load a large
JPEG image (say 3000x2000 pixels) that I'm trying to create a 100
pixel thumbnail. I have the code working where I generate the
thumbnail, but it's not maintaining the aspect ratio of the
original image. It's making it square, filling in white for the
part that doesn't fit.
I've tried just setting the height or width of the new
image, but that doesnt render well, either.
To see what I'm talking about, I made a screen shot, showing
the before image, and the rendered as thumbnail image:
Image of demo
app at Flickr.
Now, there's a few things important to note. I'm saving the
thumbnail off as a JPEG. As you can see in my sample application,
the original renders fine with the proper aspect ratio, it's when
I'm copying the bytes off the bitmapdata object, where I need to
specify a width and height, that the trouble starts. I've also
tried using .contentHeight and .contentWidth and some division to
manually specify a new bitmapdatasize, but these values seem to
always have NaN.
private function makeThumbnail():void{
// create a thumbnail of 100x100 pixels of a large file
// What I want to create is a a thumbnail with the longest
size of the aspect
// ratio to be 100 pixels.
var img:Image = new Image();
//Add this event listener because we cant copy the
BitmapData from an
/// image until it is loaded.
img.addEventListener(FlexEvent.UPDATE_COMPLETE,
imageLoaded);
img.width=100;
img.height=100;
img.scaleContent=true;
img.visible = true;
// This is the image we want to make a thumbnail of.
img.load("file:///C:/T5.jpg");
img.id = "testImage";
this.addChildAt(img, 0);
private function imageLoaded(event:Event):void
// Grab the bitmap image from the Input Image and
var bmd:BitmapData =
getBitmapDataFromUIComponent(UIComponent(event.target));
//Render the new thumbnail in the UI to see what it looks
theImage.source = new Bitmap(bmd); //new Bitmap(bmd);
public static function
getBitmapDataFromUIComponent(component:UIComponent):BitmapData
var bmd:BitmapData = new
BitmapData(component.width,component.height );
bmd.draw(component);
return bmd;
}Hi Tod,
Take a look at this post:
I'll have to say the smoothing of the thumb is not perfect, but maybe in combination with your code.. you get good results.
Post a solution if you acheive better smooth thumb results.
Link to forum post:http://forums.adobe.com/message/260127#260127
Greets, Jacob -
Help Needed Trying To Publish To Web
i am new to this so go easy!
i have oracle portal running fine, with a basic installation linking to another machine runnnig the db. all is working great - and i have developed a small site which is pulling through data correctly etc - and looks great.
the server name it is running on is "SVORAAS" so to access and do any development ive been typing into the browser "http://svoraas/pls" and then loging in etc. i have set different users up with correct access etc.
now - i have registed a domain name - and this machine is behind the fire wall with ip 212.58.xxx.xx and name www.clixxx.co.uk
however what do i need to do so that the oracle apps server "serves" to www.clixxx.co.uk so i can type in to any browser on the internet http://www.clixxx.xo.uk/pls and be able to login to see the stuff i have done
i have played around with http.conf files and numerous other things like DAD/SSO's etc which i have no idea about!
basically i want to be able for people on the net to have access to the stuff ive developed! surely this is normal - but i cant find anything to help me out!
timMore to it than just the httpd.conf. If you have metalink access, review Note:218031.1 Subject: Configuring Multiple URLs With Portal 9.0.2 Using Virtual Hosts
-
Trying to recreate this graphic in Fireworks CS3
Hello folks, I'm a newbie at Fireworks and so I'm having a
bit of trouble figure out how to recreate a similar graphic to
this, with the curved lines that are thicker on one end and curve
into a point. Here's the graphic:
http://moretech.us.com/wp-content/themes/premiumnews/images/ennergi_swishes.gif
Could anyone give me a quick primer, or possibly even direct
me to a tutorial, that will explain how to make this?
Thanks!Alex is right, you should learn to use the pen tool for
projects like
this... but there is a shortcut that will work pretty well
for this
particular image...
open teh gif in FW
use teh magic wand to select one of the three sections of
color
choose select->convert to paths
repeat for the other two shapes
(another) Alex
"MoreTech" <[email protected]> wrote in
message
news:flo38c$52s$[email protected]..
> Hello folks, I'm a newbie at Fireworks and so I'm having
a bit of trouble
> figure out how to recreate a similar graphic to this,
with the curved
> lines
> that are thicker on one end and curve into a point.
Here's the graphic:
>
>
http://moretech.us.com/wp-content/themes/premiumnews/images/ennergi_swishes.gif
>
> Could anyone give me a quick primer, or possibly even
direct me to a
> tutorial,
> that will explain how to make this?
>
> Thanks!
> -
Help needed - trying to programatically change a report
I want to write a VB program that can open a crystal 2008 report, change the size of 1 field, add a text box, and save the report.
I can open the report, change a field size, and save it, but I don't know how to add an object.
There is no add method for the reportobjects collection.
Any hints / ideas / sample code?
ThanksYou will need to be using CR XI R2 SP2 or later so that you can use inproc RAS to do this.
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.ReportAppServer.ClientDoc;
//CR Declarations
ReportDocument m_boReportDocument;
ISCDReportClientDocument m_boReportClientDocument;
CrystalDecisions.ReportAppServer.ReportDefModel.ReportObject m_boReportObject;
CrystalDecisions.ReportAppServer.ReportDefModel.ReportObject m_boReportObjectModified;
CrystalDecisions.ReportAppServer.ReportDefModel.Section m_boSection;
CrystalDecisions.ReportAppServer.ReportDefModel.TextObject m_boTextObject;
CrystalDecisions.ReportAppServer.ReportDefModel.Paragraphs m_boParagraphs;
CrystalDecisions.ReportAppServer.ReportDefModel.Paragraph m_boParagraph;
CrystalDecisions.ReportAppServer.ReportDefModel.ParagraphElements m_boParagraphElements;
CrystalDecisions.ReportAppServer.ReportDefModel.ParagraphTextElement m_boParagraphTextElement;
CrystalDecisions.ReportAppServer.ReportDefModel.FontColor m_boFontColor;
CrystalDecisions.ReportAppServer.ReportDefModel.Font m_boFont;
//create a new ReportDocument
m_boReportDocument = new ReportDocument();
//load the RPT file
m_boReportDocument.Load("..
DummyReport.rpt");
//access the ReportClientDocument in the ReportDocument (EROM bridge)
m_boReportClientDocument = m_boReportDocument.ReportClientDocument;
//first determine which area and section to add the text field to - in this case the ReportHeaderArea first's section
m_boSection = m_boReportClientDocument.ReportDefController.ReportDefinition.ReportHeaderArea.Sections[0];
//create the textobject
m_boTextObject = new CrystalDecisions.ReportAppServer.ReportDefModel.TextObject();
//create the paragraph elements for the textobject
m_boParagraphs = new CrystalDecisions.ReportAppServer.ReportDefModel.Paragraphs();
m_boParagraph = new CrystalDecisions.ReportAppServer.ReportDefModel.Paragraph();
m_boParagraphElements = new CrystalDecisions.ReportAppServer.ReportDefModel.ParagraphElements();
m_boParagraphTextElement = new CrystalDecisions.ReportAppServer.ReportDefModel.ParagraphTextElement();
//set the text value for the text field
m_boParagraphTextElement.Text = "This is the added text field in the reportheader";
m_boParagraphTextElement.Kind = CrystalDecisions.ReportAppServer.ReportDefModel.CrParagraphElementKindEnum.crParagraphElementKindText;
//fix some wierd defaults and behavior by explicitly setting default font
m_boFontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
m_boFont = new CrystalDecisions.ReportAppServer.ReportDefModel.Font();
m_boFont.Bold = true;
m_boFont.Name = "Arial";
m_boFontColor.Font = m_boFont;
m_boParagraphTextElement.FontColor = m_boFontColor;
m_boParagraphElements.Add(m_boParagraphTextElement);
m_boParagraph.ParagraphElements = m_boParagraphElements;
m_boParagraphs.Add(m_boParagraph);
m_boTextObject.Paragraphs = m_boParagraphs;
//now add it to the section
m_boTextObject.Left = 2000;
m_boTextObject.Top = 1;
m_boTextObject.Width = 5000;
m_boTextObject.Height = 226;
m_boReportClientDocument.ReportDefController.ReportObjectController.Add(m_boTextObject, m_boSection, -1);
//display in reportviewer
crystalReportViewer1.ReportSource = m_boReportDocument;
Jason -
Help! Trying to get a Video File off a DVD so I can use it in Final Cut Pro
Okay. I'm trying to cut together a project and I need the video and audio off a short DVD. The DVD is under 5 minutes in length and is not copy right protected. For the life of me I cannot understand how to convert the files off the DVD to something I can work with. When I open the DVD I have 2 files: 1) AUDIO_TS and 2) VIDEO_TS. I would like to convert these to something FCP can understand (AVI, MPEG...anything). I have searched and searched the message boards and have found no useful information. I have a feeling it's something to do with Disk Utility but have found no clear instructions. Half the sites want you to buy their software. Surely there is some way to do this without buying additional software. Any help would be greatly apppreciated.
There are four ways that I know of:
1) Play the DVD and have the player's analog outputs connected to your DV VCR or camcorder, which then acts as a convertor to bring it into FCP
2) MPEG StreamClip - FREE, rips the video and audio from the VIDEO_TS folder
3) DVDxDV - $20 or so, does the same thing as MPEG-Streamclip only a little easier, IMO
4) Cinematize - $70, same thing, more options
Maybe you are looking for
-
Error while using Photoshop CS5 on my Mac book pro 10.5.8
Everytime i open a new page to work on my Photoshop cs5 trial version, i am getting an error that 'Startup disk' is too full, delete some to create some space. i don't know what that means, as i am trying to locate startup disk on my computer, but al
-
Issue in MODVAT Clearing Account and Rounding off of Excise.
I have one issue in MODVAT Clearing Account and Rounding off of Excise. Example: Material cost 100Rs. Excise value 1. BED 10.5 Rs 2. ECes 2.1 Rs 3. HEces 1.3.Rs At the time of GR Material Ac Dr 100
-
OK, the display brightness issue exsists. There is some software out there that does help (Gamma Control). So it seems like it can be fixed. Is Apple going to address this issue? Some people are saying that Apple is catering to the average consumer (
-
Error occur when terminting several running process
Dear all, when I terminate the several existent procsses with status 'Running', the server is immediately down. And I have to reboot the server to fix this problem. Can someone explain this error message? The error message is shown as follow: 2010-12
-
Add moved /users to new install
Hello, I moved my /users directory using the 'Advanced Options' under Accounts in System Prefs to another drive. My boot drive is simply for apps and only maintains an 'admin' user account for recoverability purposes. My issue is that I recently in