Alert on action
Hi ,
In Comaplaints(return and replcaments) if there are more than one line item and if i click on the action button then one window comes with all these line items here i have to select the line item then i have to select the relevant action, if i donot select any line item and click the ok button then nothing happens and if i select any line and click on the action then opted action is exectued .
My requitrement is if i dont select any line item then one alert should come which should indicates to select minimum one line item .
How this can be achieved ? if this can be achieved by BAdi please any body experience in this area give the name of BAdi and how the selection of line item can be made available in the implementation of BAdi.
Thanks
Saj
Before to invest in any add-on, you may try SP Transaction Notification to achieve your goal. Search this forum first if you don't much about this SP. There are quite a few threads discussing it.
Thanks,
Gordon
Similar Messages
-
E-mail Alert Notification Action doesn't work
Don't receive Alert notifications on email.
Attributes-> Actions-> Critical Action send to email.
At occurrence Critical Alert of the notification are not sent on email.
If a host or the agent are not accessible, the notification is sent on my email.
How to solve this problem or where see Actions log.
I use the built in module of sending notificationns email.sh.
Whether it's necessary to adjust on each server "Sendmail" for sending notifications or to adjust "Sendmail" on a server where it's installed SunMC.
Enough in that case it's better to use Halcyon PrimeAlert EventAction????
Any Idea?You're right: if you're using the default out-of-the-box email actions, then you need to make sure sendmail is set up on every system with an Agent.
Quite often production systems are running restricted Solaris installs without sendmail, or are behind a firewall that denies email.. that's when you'd really want EventAction (so you only need sendmail on your SunMC Server).
EventAction really is the way to go for any kind of SunMC notification/integration... ...but I work for Halcyon, so you have to assume I'm a biased vendor :)
Regards,
[email protected]
http://www.HalcyonInc.com -
My alert is working fine but I see "NT ACTION" in my alert email.How do I get rid of that.
Thanks,
--John.Just delete or disable the action and create the action again. and add it to the action set and then fire the alert.
It will then remove the junk value 'NT Action' from the alert.
Regards,
Vineet -
New Item Alert folder action?
I believe I need one of these...
I'm a photographer and will be shooting a job this weekend using a camera that will transfer images (jpegs) to my Powerbook as they're shot. That part works great.
What I want to do and haven't figured out is how is to display the images as they arrive at the laptop so my clients can see the photos as I'm shooting them. Assuming Preview as the app, I'd like to have an event handler attached to the incoming_folder do something like this:
when new_file arrives in incoming_folder
close any open Preview windows
have Preview display new_file
end
There should only be the most recent file open.
The problem I'm facing is that I don't have time to learn enough Applescript to pull this off in the next few days. Long-term I want learn Applescript, but I need a solution pronto.
Can someone help me with this?Yes. You don't necessarily need to edit the script, you just need to attach the Folder Action to each and every folder you want to watch.
-
Alerts are LOST somewhere in Action Override Stage...
I have very, very strange statistics on my sensor. I cleared it few minutes ago and now it is as follows:
SigEvent Preliminary Stage Statistics
Number of Alerts received = 60
Number of Alerts Consumed by AlertInterval = 0
Number of Alerts Consumed by Event Count = 0
Number of FireOnce First Alerts = 0
Number of FireOnce Intermediate Alerts = 0
Number of Summary First Alerts = 8
Number of Summary Intermediate Alerts = 43
Number of Regular Summary Final Alerts = 8
Number of Global Summary Final Alerts = 0
Number of Active SigEventDataNodes = 10
Number of Alerts Output for further processing = 60
SigEvent Action Override Stage Statistics
Number of Alerts received to Action Override Processor = 60
Number of Alerts where an override was applied = 0
Actions Added
deny-attacker-inline = 0
deny-attacker-victim-pair-inline = 0
deny-attacker-service-pair-inline = 0
deny-connection-inline = 0
deny-packet-inline = 0
modify-packet-inline = 0
log-attacker-packets = 0
log-pair-packets = 0
log-victim-packets = 0
produce-alert = 0
produce-verbose-alert = 0
request-block-connection = 0
request-block-host = 0
request-snmp-trap = 0
reset-tcp-connection = 0
request-rate-limit = 0
SigEvent Action Filter Stage Statistics
Number of Alerts received to Action Filter Processor = 0
Number of Alerts where an action was filtered = 0
Number of Filter Line matches = 0
Number of Filter Line matches causing decreased DenyPercentage = 0
Actions Filtered
deny-attacker-inline = 0
deny-attacker-victim-pair-inline = 0
deny-attacker-service-pair-inline = 0
deny-connection-inline = 0
deny-packet-inline = 0
modify-packet-inline = 0
log-attacker-packets = 0
log-pair-packets = 0
log-victim-packets = 0
produce-alert = 0
produce-verbose-alert = 0
request-block-connection = 0
request-block-host = 0
request-snmp-trap = 0
reset-tcp-connection = 0
request-rate-limit = 0
SigEvent Action Handling Stage Statistics.
Number of Alerts received to Action Handling Processor = 1
Number of Alerts where produceAlert was forced = 0
Number of Alerts where produceAlert was off = 0
Actions Performed
deny-attacker-inline = 0
deny-attacker-victim-pair-inline = 0
deny-attacker-service-pair-inline = 0
deny-connection-inline = 0
deny-packet-inline = 0
modify-packet-inline = 0
log-attacker-packets = 0
log-pair-packets = 0
log-victim-packets = 0
produce-alert = 1
produce-verbose-alert = 0
request-block-connection = 0
request-block-host = 0
request-snmp-trap = 0
reset-tcp-connection = 0
request-rate-limit = 0
Per-Signature SigEvent count since reset
Sig 60000.0 = 1
Yes, single signature fired, but the number of "Preliminary Stage Alerts" was 60 !? What happened with other 59 alerts ???Only when the alert has at least one action will it be passed to the event action handler.
So the other 59 alerts did not have any event action. Either no action was added directly from the signature definition, or the alerting type actions were removed because of summarization, or the actions were removed by filters.
There are several signatures that are intentionally created without actions. These signatures are what we call meta component signatures. On their own they don't mean much and so we remove all actions and they do not generate alerts into the eventstore. They trigger internally in sensorApp but do not get written to the eventstore. These alerts are internally monitored by Meta signatures. When multiple component signatures are triggered, then a Meta signature may trigger and it is the Meta signature that would have a produce-alert event action and be written to the eventStore.
With summarization the signature has a produce-alert action, but the summarizer routines see that the signature is being triggered multiple times with same addresses. The summarizer will allow through an alert on the first triggering. Later triggerings with the same address set will cause the summarizer to automatically remove the produce-alert action (and other alert causing actions). So the summarized alerts will not get written to the eventStore.
NOTE: In your output this happened for at least 43 of these alerts.
Filters may also be matching the alerts, and the filters may be removing the event actions.
So if the event actions have all be removed (or none were ever added), then the alert will not be passed to the event action handler.
In your output only 1 of the 60 alerts wound up with any actions needing to be executed. -
ERROR WHILE RUNNING ODI SCENARIO FROM BAM ALERT
We are using oracle data integrator 11g and have created an ODI Scenario and able to run the scenario from ODI studio client.
We have done the configuration for BAM-ODI integration as mentioned in http://docs.oracle.com/cd/E21764_01/integration.1111/e10224/bam_odi.htm#BABEJIGD
We have started ODI Agent, soa and bam servers. Created a BAM alert -> select action - Run ODI Scenario -> selected the same scenario.
Alert ran at scheduled time but failed with following error:
java.io.IOException : truncated data integrator frame received
Error Message (if any)
[2012-08-06T11:24:21.046+05:30] [bam_server1] [WARNING] []
[oracle.bam.eventengine] [tid: bam-pool-Action-thread-1] [userId:
OracleSystemUser] [ecid:
3576f9092ef9497a:-743c430a:138fa7450c3:-8000-00000000000000a8,1:23453] [APP:
oracle-bam#11.1.1] EventEngine: Error occured while running a ODI Scenario.
[2012-08-06T11:24:21.250+05:30] [bam_server1] [ERROR] []
[oracle.bam.eventengine] [tid: bam-pool-Action-thread-1] [userId:
OracleSystemUser] [ecid:
3576f9092ef9497a:-743c430a:138fa7450c3:-8000-00000000000000a8,1:23453] [APP:
oracle-bam#11.1.1] EventEngine: Action exception: EEInstEv2 EEInstAct1 Rule
Id: 2 exception: java.io.IOException: truncated Data Integrator Frame
received
[2012-08-06T11:24:21.250+05:30] [bam_server1] [WARNING] []
[oracle.bam.eventengine] [tid: bam-pool-Action-thread-1] [userId:
OracleSystemUser] [ecid:
3576f9092ef9497a:-743c430a:138fa7450c3:-8000-00000000000000a8,1:23453] [APP:
oracle-bam#11.1.1] EventEngine: Exception stack trace: [[
at
oracle.bam.eventengine.engine.event.action.RunScenario.invokeScenario(RunScena
rio.java:145)
at
oracle.bam.eventengine.engine.event.action.ActionProcessor.runScenario(ActionP
rocessor.java:891)
at
oracle.bam.eventengine.engine.event.action.ActionProcessor.actionHandler(Actio
nProcessor.java:337)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.j
ava:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.bam.system.Delegate$Sink.invoke(Delegate.java:80)
at oracle.bam.system.Delegate.dynamicInvoke(Delegate.java:186)
at
oracle.bam.common.threading.threadpool.ThreadPoolController$PoolQueueItem.proc
essWorkRequest(ThreadPoolController.java:155)
at
oracle.bam.common.threading.threadpool.ThreadPoolController$PoolQueueItem.run(
ThreadPoolController.java:128)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java
:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908
at java.lang.Thread.run(Thread.java:619)
Any help on this is highly appreciated...
Thanks
Rajdip MukherjeeHi,
Forgot to include the ODI classes RunScenario.invokeScenario() is invoking odi scenario using odi sdk api. Please see the below stack trace :-
java.io.IOException: truncated Data Integrator Frame received
at
oracle.odi.sdk.invocation.internal.AgentNetworkCmd.readCmd(AgentNetworkCmd.java:303)
at
oracle.odi.sdk.invocation.OdiInvocation.invokeCommand(OdiInvocation.java:176)
at
oracle.bam.eventengine.engine.event.action.RunScenario.invokeScenario(RunScenario.java:140)
at
oracle.bam.eventengine.engine.event.action.ActionProcessor.runScenario(ActionProcessor.java:891)
at
oracle.bam.eventengine.engine.event.action.ActionProcessor.actionHandler(ActionProcessor.java:337)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Thanks
Rajdip Mukherjee -
Number of Alerts Consumed by AlertInterval
When I do a show stat virt I see the following information:
Number of Alerts Consumed by AlertInterval = 744
Sig 3653.0 = 744
What does this mean? I checked the signature and the Alert Interval is set to 2. The Action is set to Produce Alert, so I am expecting it to send an alert to IME, but I don't see it.Only when the alert has at least one action will it be passed to the event action handler.
So the other 59 alerts did not have any event action. Either no action was added directly from the signature definition, or the alerting type actions were removed because of summarization, or the actions were removed by filters.
There are several signatures that are intentionally created without actions. These signatures are what we call meta component signatures. On their own they don't mean much and so we remove all actions and they do not generate alerts into the eventstore. They trigger internally in sensorApp but do not get written to the eventstore. These alerts are internally monitored by Meta signatures. When multiple component signatures are triggered, then a Meta signature may trigger and it is the Meta signature that would have a produce-alert event action and be written to the eventStore.
With summarization the signature has a produce-alert action, but the summarizer routines see that the signature is being triggered multiple times with same addresses. The summarizer will allow through an alert on the first triggering. Later triggerings with the same address set will cause the summarizer to automatically remove the produce-alert action (and other alert causing actions). So the summarized alerts will not get written to the eventStore.
NOTE: In your output this happened for at least 43 of these alerts.
Filters may also be matching the alerts, and the filters may be removing the event actions.
So if the event actions have all be removed (or none were ever added), then the alert will not be passed to the event action handler.
In your output only 1 of the 60 alerts wound up with any actions needing to be executed. -
Hi ,
We have created a alert and defined two action items under the same. That's a periodic alert.
Action items defined are 1) Send mail 2) Call concurrent program.
In case of mail action item mails are getting sent, depending upon the number of record select statement fetch. But Concurrent programs is getting called only once. we want that the concurrent program should get submit number of times the records get fetched in the select statement. we are also passing the parameter in the concurrent request that is person id.
Can any body help us on the same.
Thanks & regards,
Ankur DawraAs an HR update means inserting a new record and end dating the one changed, the alert would have to be created for the insert table of hr_assignments. Then create a stored procedure to receive the position and the start date of the new assignment record, select the previous assignment record position (end date = start date -1 ) and compare to the new and evaluate if it was changed.
-
Action & onMouseClicked Button Events
Hola!
There's something I don't understand why happen.
A button with action and onMouseClicked events:
Stage {
title: "MyApp"
scene: Scene {
width: 100, height: 100
content: [
Button {
text: "Button"
action: function() {
println("action!!");
onMouseClicked: function(e: MouseEvent): Void {
println("onMouseClicked!!");
}During execution, if I press the button, it will print:
action!!
onMouseClicked!!
Good! All right!
But, if I add and Alert popup in action event, like that:
Stage {
title: "MyApp"
scene: Scene {
width: 100, height: 100
content: [
Button {
text: "Button"
action: function() {
println("action!!");
Alert.inform("action!!"); // <--------------------------------------
onMouseClicked: function(e: MouseEvent): Void {
println("onMouseClicked!!");
}the onMouseClicked event function will not execute anymore.
Why?? O_oHola!
There's something I don't understand why happen.
A button with action and onMouseClicked events:
Stage {
title: "MyApp"
scene: Scene {
width: 100, height: 100
content: [
Button {
text: "Button"
action: function() {
println("action!!");
onMouseClicked: function(e: MouseEvent): Void {
println("onMouseClicked!!");
}During execution, if I press the button, it will print:
action!!
onMouseClicked!!
Good! All right!
But, if I add and Alert popup in action event, like that:
Stage {
title: "MyApp"
scene: Scene {
width: 100, height: 100
content: [
Button {
text: "Button"
action: function() {
println("action!!");
Alert.inform("action!!"); // <--------------------------------------
onMouseClicked: function(e: MouseEvent): Void {
println("onMouseClicked!!");
}the onMouseClicked event function will not execute anymore.
Why?? O_o -
Corrective Action on Agent Unreachable?
Let me first explain exactly what I am looking to do. My current setup is a repeating job that recreates connections (tunnels) to the agent boxes every 15 minutes to ensure that connections stay up. This can get hung up and drag the network down. Ideally, I would like to setup an automated system to correct the issues. If an Agent becomes unreachable, I want to initiate a corrective action that will try to recreate the connection. I was told that the corrective action would be run ON THE AGENT, which would inevitably fail if there was no connection. So a 2nd task would be added to the corrective action in response to the first failed task, that would run the connection scripts on the OEM box and re-establish connection. If that fails as well, then I would like a notification to be sent out (incident rules typically).
That is my ideal set up. Here are the issues I am running into. The first is that the Agent Unreachable does not seem to be an editable metric. It is listed as a metric called Response > Status, under All Metrics. However, under Metric settings, it can not be edited, and thus, I do not see a way to tie a corrective action to this metric. Once I do tie the corrective action to this metric, do I need to set up a job to run in the corrective action or is the corrective action basically a job that runs in response to an event? That is how I understood it...just looking for verification. It would be greatly appreciated if I could be pointed in the correct direction.I'm not sure you can do this through a metric alert corrective action, but it sounds like a great enhancement request. You didn't mention the EM version that you're using, but if you're on EM12c you can implement something like this through an advanced notification method. There's more than one way to do it but here's what I just tested and confirmed will work:
1) Generate an ssh key for the oracle user running the OMS, and save the key with no password
2) Copy the generated public key to $HOME/.ssh/authorized_keys for the user running the agent on the host where you would like to restart the agent
3) Create a shell script owned by the OMS oracle user that contains the line "ssh [email protected] /pathtoagent/bin/emctl start agent"
4) Log in to EM12c as user SYSMAN and create an advanced notification method that calls the shell script created in step 3
5) Create an incident ruleset applying to the agent target
6) Create an rule in the ruleset that applies to incoming incidents where Category = Availability and Severity = Critical
7) Create an action for that rule that calls the advanced notification method from step 4
Then stop the agent to test it. Once the incident is generated, the notification method will run, ssh from the OMS host to the agent host, and start up the agent again.
It doesn't look like you can pass parameters to the notification methods, so you may need to create a separate notification method and separate shell script for every agent you monitor.
You could probably also do this through an SNMP trap advanced notification if you have other management software on your network that could catch the trap and respond to it appropriately.
But for me the real question would be: why are your agents going unreachable so often that you need to bother with this? -
Alert class import causes errors
Hello,
I am the local new guy. I have followed many examples of how to create an alert popup window and have failed.
Background:
added alert component to stage and delete, component shows up in library
added import mx.controls.Alert
to actions layer first frame of fla file
When I control enter to create the file, I get these wierd errors, 16 of them in fact
rainging form there is no method to no poperty
here they are:
**Error** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\managers\PopUpManager.as: Line 123: There is no method with the name 'deactivate'.
SystemManager.deactivate(o);
**Error** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\controls\TextArea.as: Line 361: There is no property with the name '_color'.
_color = UIObject.textColorList;
**Error** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\controls\TextArea.as: Line 363: There is no property with the name 'focusTextField'.
focusTextField = label;
**Error** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\containers\Window.as: Line 348: There is no property with the name 'clickHandler'.
button_mc.clickHandler = delegateClick;
**Error** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\controls\alertClasses\AlertForm.as: Line 159: There is no method with the name 'createClassChildAtDepth'.
var o:Button = Button(createClassChildAtDepth(Button, DepthManager.kTop,
**Error** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\controls\alertClasses\AlertForm.as: Line 166: There is no property with the name 'clickHandler'.
o.clickHandler = onClick;
**Error** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\controls\alertClasses\AlertForm.as: Line 167: There is no property with the name 'detail'.
o.detail = detail;
**Error** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\controls\alertClasses\AlertForm.as: Line 212: There is no property with the name 'width'.
extent.width += icon_mc.width + 8;
**Error** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\controls\alertClasses\AlertForm.as: Line 218: There is no property with the name 'height'.
var i:Number = icon_mc.height - (numlines * (extent.height + 4));
**Error** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\controls\alertClasses\AlertForm.as: Line 263: There is no property with the name 'height'.
icon_mc.move(x, (height - buttons[0].height - icon_mc.height) / 2);
**Error** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\controls\alertClasses\AlertForm.as: Line 264: There is no property with the name 'width'.
x += icon_mc.width + 8;
**Error** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\controls\scrollClasses\ScrollBar.as: Line 272: There is no property with the name 'height'.
var y:Number = ((pos-minPos) * (scrollTrack_mc.height-scrollThumb_mc._height) / (maxPos - minPos)) + scrollTrack_mc.top;
**Error** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\controls\scrollClasses\ScrollBar.as: Line 494: There is no property with the name 'height'.
thumbHeight = pageSize / (maxPos-minPos+pageSize) * o.height;
**Error** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\controls\scrollClasses\ScrollBar.as: Line 497: There is no property with the name 'height'.
if (o.height < st.minHeight)
**Warning** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\controls\Alert.as: Line 27: There is no class or package with the name 'mx.containers' found in package 'mx'.
static var symbolOwner:Object = Window;
**Warning** C:\Users\jim\AppData\Local\Macromedia\Flash 8\en\Configuration\Classes\mx\controls\Alert.as: Line 213: There is no class or package with the name 'mx.controls.alertClasses' found in package 'mx.controls'.
var tmp = AlertForm;
Total ActionScript Errors: 16 Reported Errors: 16
funny thing is that when i create the same code
import etc alert.show etc in a new fla file it works just fine, when i use the working code from the new fla and place it here not changing anything it fails with the previoulsy mentioned errors,
I have checked the class path, i have added the direct folder of the classes, I have even tried to import the .AS file it self with no luck.
Any suggestions here?
Thanks
JimAhhhhh...thank you!
One other question that is related...
So now it imports the class ApplicationMain.as.
But now there are path issues that I can't quite figure out.
So I have a scene called Content - my main and only scene.
In that scene there is a MC called content_MC as well as 2 buttons; a print button and a start over button.
Inside the content_MC there are several objects, including those that are labeled with instances that are meant to point the ApplicationMain file to them so they can have the ApplicationMain.as class applied to them.
I have an AS layer/frame inside content_MC that imports the ApplicationMain class just as you suggested.
Inside the ApplicationMain.as file the targets are registered as e1, e2, e3, e4, etc.
These instances, e1, e2, etc, are located inside content_MC on a layer below the AS layer where the import of the ApplicationMain code is located.
When I export the SWF I get error 1120 access to undefined property e1. This error occurs for each instance I am trying to target.
This is clearly a path issue but don't understand...?
Shouldn't those instances be found by the ApplicationMain.as class since they are resident in the same movie clip where the ApplicationMain.as class is being imported into?
Here's how the targets are registered in the ApplicationMain.as file...
_transformTool.targets = [e1, e2, e3, e4, f1, f2, f3, f4, f5, f6, f7, f8];
Man, AS3 is making my head spin!
Thanks a ton for your help! -
Help on moving specific files using folder actions
so i want to move all downloaded files that have the extension .pdf to a folder in my docs but it doesnt always work and if i download 2 at once it fails. im new to applescripts so please help!
this is what i have:
on adding folder items to this_folder after receiving added_items
tell application "Finder"
repeat with all_items in this_folder
if the name extension of any_item is "pdf" then
move item to folder "Macintosh HD:Users:Campbell:Documents:Printing"
end if
end repeat
end tell
end adding folder items toAs written, you are referring to different variables in your repeat loop for the added items (all_items, any_item, etc). The loop variable you define in the repeat statement is the one to use.
Snow Leopard added a time delay to check if items are still being downloaded, but in Leopard you will need to do it yourself. The following script adds a wait handler that will wait for files to be downloaded (I also threw in a run handler for testing):
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
font-weight: normal;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 340px;
color: #000000;
background-color: #DAFFB6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
property destination : "Macintosh HD:Users:Campbell:Documents:Printing"
property someTime : 60 -- time (in seconds) to allow files to copy/download
on run -- application double-clicked or run from the Script Editor
set theFolder to (choose folder)
tell application "Finder" to set theItems to files of theFolder as alias list
adding folder items to theFolder after receiving theItems -- process entire folder contents
end run
on adding folder items to this_folder after receiving added_items -- folder action
if (waitForFilesToCopy into this_folder for someTime) then
doStuff for added_items
else
display alert "Folder Action error" message "File copy/download into folder " & quoted form of POSIX path of this_folder & " did not complete in the time allowed."
end if
end adding folder items to
to doStuff for someFiles
do stuff with each file in someFiles
parameters - someFiles [list]: a list of files to do stuff with
returns nothing
repeat with anItem in someFiles
tell application "Finder"
if the name extension of anItem is "pdf" then
move anItem to folder destination
-- move anItem to (path to desktop) -- testing
end if
end tell
end repeat
end doStuff
to waitForFilesToCopy into someFolder for timeToWait
checks every interval seconds up to timeToWait for files to be copied/downloaded to theFolder
the test is based on the size of the folder not changing after interval seconds
parameters - someFolder [mixed]: the folder to check
timeToWait [integer]: a maximum timeout value in seconds
returns [boolean]: true if copy/download finished, false if timeout
set interval to 2 -- adjust as desired
set someFolder to quoted form of POSIX path of someFolder
set currentSize to first word of (do shell script "du -s " & someFolder) -- get initial size
repeat with timer from timeToWait to 1 by -interval
delay interval
set newSize to first word of (do shell script "du -s " & someFolder) -- recheck size
if (newSize is equal to currentSize) then
return true -- success
else -- update size
set currentSize to newSize
end if
end repeat
return false -- timed out
end waitForFilesToCopy
</pre> -
Problems Moving Time Machine to New Hard Drive, Error -8062
I'm in 10.8.5, trying to copy my Backups.backupsb folder from my current 2TB ext drive to a new 4TB drive, following Apples instructions for changing the Time Machine drive. Both are Seagates, single partitioned (GUIDE) formatted Mac OS Extended (Journaled.)
The 2TB is nearly full, hence the move. This morning after 12 hours of the projected 14 to copy the backups file over, I got an alert that action could not be completed because of Error 8062 I've found pages with suggested fixes from simple restart to more elaborate measures. The one thing I've done so far is restart and check Disk Permissions for both drives, which read as okay.
But before trying again, since error occured 12 hours into the process (of course it did,) I would like to see if the portion of the file that shows in the folder, size 1.46TB out of the 1.93 total, could be "replaced" by the original folder and thus not have to copy everything again.
One apparent problem is that, after a similar attempt to do similar replacement after a problem 3 hours into copying, instead of asking if I wanted to replace it, it just started copying it with "(original)" added to the end of the folder name. That file tagged (original) is the 1.46TB partial copy. So I deleted the much smaller initial partial copy, but of course the *true* original folder from the active Time Machine will not replace the existing partial copy. I don't know if removing (original) from its name so it matches will help because I can't; the folder is greyed out and I can't alter the name. I've tried changing Permissions on it, and tried Terminal commands that will supposedly change the name of a hidden file - nothing works. Of course, I don't even know if it would ask to "replace" the next time I try, since it didn't do so when the folder names matched on the first attempt. And since *when* does Finder not ask to "replace" an identically named folder, anyway? This begs the question if it is simply not going behave like a normal folder with files no matter what I do to it.
Is there anything else I can try? Barring a solution, any other precautions I might take to try to avoid the joy of anohter "cannot complete" 12 hours in? I've got multiple backups to make of loads of data, including a full extra backup to keep offsite, and would love to avoid such time wasters.
Thanks for you kind assistance!
BrianThis looks right on point and very thorough. I've started a new backup directly to the new drive. Since I don't necessarily need the old drive for storage of anything else for the time being, I will probably do as he recommends and keep the old backups ther, at least until I'm reasonably sure I'm never going to need anything dating back that far, and long enough to confirm the new configuration is stable, and everything is there and backed up off site.
I"m all for simple solutions right now! :^) -
Batch combine files into one illustrator document - how to open target document?
I am making a script which will:
1) Open a folder of Illustrator files
2) Open each file in the folder (these files are called the source files)
3) Select all the contents of the source file
4) Copy the contents of the source file
5) Paste these contents into a target file as a new layer
6) Ensure the new layer has the same name as the old source file
However, I don't know how to tell Illustrator where my target file is. How can I do this?
Also, when I paste, how can I turn off paste rembers layers. (So the layers get pasted into the new layer that has the same name as the old document).
Here is my code:
// JavaScript Document
//Set up vairaibles
var destDoc, sourceDoc, sourceFolder;
// Select the source folder.
sourceFolder = Folder.selectDialog('Select the folder with Illustrator files that you want to mere into one', '~');
// If a valid folder is selected
if (sourceFolder != null) {
files = new Array();
// Get all files matching the pattern
files = sourceFolder.getFiles();
if (files.length > 0) {
// Get the destination to save the files
destDoc = document.selectDialog('Select the final saved document', '~');
for (i = 0; i < files.length; i++) {
sourceDoc = app.open(files[i]); // returns the document object
var myLayers = sourceDoc.layers; // All layers in Active Document
//Go through all layers of source document and copy artwork
for (i = 0; i < myLayers.length; i++) {
myLayers[i].hasSelectedArtwork = true;
with(sourceDoc) {
var count = pageItems.length;
for (var i = 0; i < count; i++) {
pageItems[i].selected = true;
redraw();
copy();
for (var i = 0; i < count; i++) {
pageItems[i].selected = false;
//Create a new title variable that has the title of the source document
var title = sourceDoc.name;
var title = title.substring(0, title.length - 4); //(remove extension from name)
//Close the Source Document
sourceDoc.close(SaveOptions.DONOTSAVECHANGES);
//Open the Destination Document and create a new layer in it that is named after the title variation
var newLayer = destDoc.layers.add();
newLayer.name = title;
//Paste into this new layer
destDoc = app.paste();
else {
alert('No matching files found');
Thanks in advance for any help
Edit: Also, when pasting, how can I paste in place instead of just pasting.I have been studying this script. It is similar to what I need except it places the source files (Instead of copying & pasting them)
http://kelsocartography.com/blog/?p=204
I have adapted the script to my needs and it works perfectly, except it has the same problem as before: It pastes the first source file, but then it endlessly starts pasting the second source file (in a loop) and so I have to force quit.
So my new question is, when looping through files how can you get illustrator to move on the next one?
The original kelsocartography had this line:
thisPlacedItem = newLayer.placedItems.add()
thisPlacedItem.file = imageList[i];
I belive this line is what makes Illustrator move onto the next file, but I am not sure how to adapt it to my code.
Here is my code so far:
function getFolder() {
return Folder.selectDialog('Please select the folder to be imported:', Folder('~'));
function importFolderAsLayers(selectedFolder) {
// if a folder was selected continue with action, otherwise quit
var myDocument;
if (selectedFolder) {
myDocument = app.documents.add();
var firstImageLayer = true;
var newLayer;
var thisPlacedItem;
// create document list from files in selected folder
var documentList = selectedFolder.getFiles();
for (var i = 0; i < documentList.length; i++) {
// open each document in file list
if (documentList[i] instanceof File) {
// get the file name
var fName = documentList[i].name.toLowerCase();
var sourceDoc = app.open(documentList[i]); // returns the document object
var myLayers = sourceDoc.layers; // Select All layers in Active Document
//Go through all layers of source document and copy artwork
for (i = 0; i < myLayers.length; i++) {
myLayers[i].hasSelectedArtwork = true;
with(sourceDoc) {
var count = pageItems.length;
for (var i = 0; i < count; i++) {
pageItems[i].selected = true;
redraw();
copy();
for (var i = 0; i < count; i++) {
pageItems[i].selected = false;
//Create a new title variable that has the title of the source document
var title = sourceDoc.name;
var title = title.substring(0, title.length - 4); //(remove extension from name)
//Close the Source Document
// check for supported file formats
if ((fName.indexOf(".eps") == -1)) {
continue;
} else {
if (firstImageLayer) {
newLayer = myDocument.layers[0];
firstImageLayer = false;
} else {
newLayer = myDocument.layers.add();
// Give the layer the name of the image file
newLayer.name = fName.substring(0, fName.indexOf("."));
// Place the image on the artboard
sourceDoc.close(SaveOptions.DONOTSAVECHANGES);
//Paste into this new layer
newLayer = app.paste();
if (firstImageLayer) {
// alert("The action has been cancelled.");
// display error message if no supported documents were found in the designated folder
alert("Sorry, but the designated folder does not contain any recognized image formats.\n\nPlease choose another folder.");
myDocument.close();
importFolderAsLayers(getFolder());
} else {
// alert("The action has been cancelled.");
// display error message if no supported documents were found in the designated folder
alert("Rerun the script and choose a folder with images.");
//importFolderAsLayers(getFolder());
// Start the script off
importFolderAsLayers(getFolder()); -
Add Column Delete in report, How to delete row using this delete Option
Hi Friends,
i have a report ,iwant to add an option DELETE in last column.When i click on DElete then respective id sholund be deleted.
My Table Is
CREATE TABLE "DUMY_FILE"
( "ID" NUMBER,
"NAME" VARCHAR2(500),
"FILE_OBJ_ID" NUMBER,
"MIME_TYPE" CLOB,
"DOC_SIZE" NUMBER,
"BLOB_CONTENT" BLOB,
"DESCRIPTION" VARCHAR2(500),
"UPLOAD_DATE" CHAR(25)
How can i do this.
Thanks
Edited by: 805629 on Nov 16, 2010 11:51 PMTrent,
Thanks for you suggestions. .. Let me explain my problem a little better ...
I have a report that lists fields associated with a report ... I have a delete icon which deletes a row and removes it from the underlying table ... however, I am trying to implement a Before header process which runs a pl/sql process that checks if the selected field is the last field in the report ... if so, I want a confirmation dialog to pop up ... if they click cancel .. then the deletion is aborted, else the field is deleted (which triggers other status changes).
Based on this logic if there is a way to implement this based on your suggestion I would appreciate it ...
Here is the process I was trying to use .... but the I have a few issues with this approach
declare
-- cursor to check if this is the last field
cursor fld_cnt is
select count(*) from prm_ptnr_rpt_fields
where report_uid = :P22_REPORT_UID;
num_flds number;
msg varchar2(300);
begin
open fld_cnt;
fetch fld_cnt into num_flds;
If num_flds > 1 then
delete from prm_ptnr_rpt_fields
where report_uid = :P22_REPORT_UID
and field_user_key = :P9_DELETED_FLD;
commit;
:P9_DELETED_FLD := NULL;
msg := :P9_FIELD_NAME || ' Field Excluded From Report' ;
apex_application.g_print_success_message := msg;
else
htp.p('<script type="text/javascript">');
htp.p('
var r=confirm("This is the last field included in this report .. \n Deleting it will Inactivate the report and remove it from schedule (if scheduled) ...\n Do you want to proceed?");
if (r==true)
{ delete from prm_ptnr_rpt_fields
where report_uid = :P22_REPORT_UID
and field_user_key = :P9_DELETED_FLD;
:P9_DELETED_FLD := NULL;
commit;
msg := :P9_FIELD_NAME || ' Field Excluded From Report' ;
update prm_ptnr_rpts
set report_status = 'INCOMPLETE',
active_report = 'N'
where report_uid = :P22_REPORT_UID;
msg := msg || ' and Report Status changed to INCOMPLETE';
apex_application.g_print_success_message := msg;
htp.p('}else {
alert("Delete Action Aborted");
htp.p('</script>');
End if;
Close fld_cnt;
end;
a) Even if I click cancel ... the field still gets deleted ...
b) :P9_DELETED_FLD is the id for the selected field ... I am setting it on the link attributes which places it on the URL ... I would rather user javascript (but not exactly sure how).
Thanks,
Gerald
Edited by: user5459177 on Feb 22, 2011 2:45 PM
Maybe you are looking for
-
MBP 15'' 2011 battery lasts only 3 hours!
Hi I bought MBP 2011 15 inch last week and received it on Monday. My configs are Model Name: MacBook Pro Model Identifier: MacBookPro8,2 Processor Name: Intel Core i7 Processor Speed: 2.2 GHz Number of Proc
-
STAR TREK moving stars effect? Plug-in or tip how to do it
I need to create the classic STAR TREK moving stars like seen in the original series and/or STAR TREK II: THE WRATH OF KHAN. Is there a plug-in ready-made for this or is there a secret? Much appreciated.
-
How To Delete a User Folder from the Catalog?
When logged into the Catalog Manager as the Administrator I am not allowed to delete individual user folders, even when the user has been deleted via the 'Manage Presentation Catalog Groups and Users' link in the front end. If the Administrator user
-
I'm sure I'm overlooking something. I have an app that offers inapp magazine purchases. Can someone tell me how to update my free sample newsstand issue? Do I simply replace/update the folio assgined as the free issue in the folio producer? Thank
-
How to use bind variable in this select statement
Hi, I have created this procedure where table name and fieldname is variable as they vary, therefore i passed them as parameter. This procedure will trim leading (.) if first five char is '.THE''. The procedure performs the required task. I want to m