Pasting filename in a panel using script
Hi Experts - I ran into a problem when trying to feed a filename into an open file dialog. I used this approach in the past with an "Open" dialog and thought same would work for "Import file" dialog box.
My main script is below:
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text = "/niw32"
session.findById("wnd[0]").sendVKey 0
OrdNum = "7237602"
set Wshell = CreateObject("WScript.Shell")
session.findById("wnd[0]/usr/ctxtCAUFVD-AUFNR").text = OrdNum
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/titl/shellcont/shell").pressContextButton "%GOS_TOOLBOX"
session.findById("wnd[0]/titl/shellcont/shell").selectContextMenuItem "%GOS_PCATTA_CREA"
'>>> these 2 lines above bring up the dialog box <<<<<
Wshell.run "c:\tmp\Scandf.vbs",1,False
'>> after the filename is dropped in the dialog box by the Scandf.vbs script it should continue with the process <<
session.findById("wnd[0]/usr/subSUB_ALL:SAPLCOIH:3001/ssubSUB_LEVEL:SAPLCOIH:1100/subSUB_KOPF:SAPLCOIH:1102/btn%#AUTOTEXT001").press
session.findById("wnd[1]/usr/sub:SAPLBSVA:0201[1]/chkJ_STMAINT-ANWSO[0,0]").selected = true
session.findById("wnd[1]/usr/sub:SAPLBSVA:0201[1]/chkJ_STMAINT-ANWSO[0,0]").setFocus
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[0]/tbar[0]/btn[11]").press
I am calling a script called Scandf.vbs where I have the filename I want to drop into the dialog box. This is the Scandf.vbs:
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
set Wshell = CreateObject("WScript.Shell")
MsgBox "in sub"
Do
bWindowFound = Wshell.AppActivate("Import file")
WScript.Sleep 1000
Loop Until bWindowFound
bWindowFound = Wshell.AppActivate("Import file")
if (bWindowFound) Then
Wshell.appActivate "Import file"
WScript.Sleep 100
Wshell.sendkeys "c:\EQ2814.txt"
WScript.Sleep 100
Wshell.sendkeys ""
end if
EQ2814.txt is the filename I want to drop in.
THe cursor is in the filename field and waiting for input. It just sits there after the dialog box is called and does not drop in the filename.
Can anybody see what I am doing wrong?
Thanks
Umur
Hi ScriptMan - getting closer I think. When I removed that line and ran it to "Import file" step and then manually started Scandf.vbs, it worked perfectly with the code and displayed the 2 MSgBox'es, then compelted rest of the script from the main routine:
Set Wshell = CreateObject("WScript.Shell")
MsgBox "in sub"
Do
bWindowFound = Wshell.AppActivate("Import file")
WScript.Sleep 1000
Loop Until bWindowFound
Msgbox "Window = 'Import file' found"
bWindowFound = Wshell.AppActivate("Import file")
if (bWindowFound) Then
Wshell.appActivate "Import file"
WScript.Sleep 100
Wshell.sendkeys ""
Wshell.sendkeys ""
Wshell.sendkeys ""
Wshell.sendkeys ""
Wshell.sendkeys "c:\EQ2814.txt"
WScript.Sleep 100
Wshell.sendkeys ""
WScript.Sleep 100
end if
Then I tried making Scandf.vbs a subroutine within the main, placed the code as follows but that still stopped at the "Import file" panel. I don't think it is a matter of recognizing the panel since when I do it manually it does see it and drop in the file name:
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text = "/niw32"
session.findById("wnd[0]").sendVKey 0
set Wshell = CreateObject("WScript.Shell")
OrdNum = "7237602"
session.findById("wnd[0]/usr/ctxtCAUFVD-AUFNR").text = OrdNum
session.findById("wnd[0]").sendVKey 0
'Wshell.run "c:\tmp\Scandf.vbs",1,False
session.findById("wnd[0]/titl/shellcont/shell").pressButton "%GOS_TOOLBOX"
session.findById("wnd[0]/shellcont/shell").pressContextButton "CREATE_ATTA"
session.findById("wnd[0]/shellcont/shell").selectContextMenuItem "PCATTA_CREA"
SecondFile
session.findById("wnd[0]/usr/subSUB_ALL:SAPLCOIH:3001/ssubSUB_LEVEL:SAPLCOIH:1100/subSUB_KOPF:SAPLCOIH:1102/btn%#AUTOTEXT001").press
session.findById("wnd[1]/usr/sub:SAPLBSVA:0201[1]/chkJ_STMAINT-ANWSO[0,0]").selected = true
session.findById("wnd[1]/usr/sub:SAPLBSVA:0201[1]/chkJ_STMAINT-ANWSO[0,0]").setFocus
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[0]/tbar[0]/btn[11]").press
Sub SecondFile
Set Wshell = CreateObject("WScript.Shell")
MsgBox "in sub"
Do
bWindowFound = Wshell.AppActivate("Import file")
WScript.Sleep 1000
Loop Until bWindowFound
Msgbox "Window = 'Import file' found"
bWindowFound = Wshell.AppActivate("Import file")
if (bWindowFound) Then
Wshell.appActivate "Import file"
WScript.Sleep 100
Wshell.sendkeys "c:\EQ2814.txt"
WScript.Sleep 100
Wshell.sendkeys ""
WScript.Sleep 100
end If
End sub
Why do you think we can't get the scandf.vbs to trigger automatically?
Best regards
Umur
Similar Messages
-
Change BG color of Panel using script (AS3)
Dear, all
I am a newbies in Flex. Now I have some trouble with thw
sample thing.
That is how can I change BackgroungColor of panel using
script(AS3)
I can do it by mxml BUT!! I really need to change it using
AS3. Does you know what should I do NEXT.When you lookup a component in FB3 help sys, if you see it
under styles, then you need to use setStyle() in AS, if you see it
as a property, just use dot notation. -
Cannot move [MOV filename]: It is in use by another person or program
Hello. I have recently installed version 7.41 of Quicktime for Windows (had the same problem with 7.4). What appears to be happening is that when I boot my computer, without opening any programs, if I go to a location where I have a MOV (Quicktime movie file) file, and try to cut and paste it to another folder it gives me the message:
Cannot move [MOV filename]: It is in use by another person or program. Close any programs that might be using the file and try again.
I have found by using some memory/file monitoring tools that EXPLORER.EXE is opening a handle to the file (accessing it for some reason) and then holding on to that handle thus not allowing me to move the file from one directory to another. By forcing the handles closed, it then allows me to move it, but then immediately maintains it open again, and cannot move it again.
This only happens with QuickTime MOV files. I have renamed the file to another format, just for kicks basically, and it works fine using another extension. I have also reassociated the MOV files with another app, but still has the same issues.
I have not run or any applications before this point and especially not anything related to QuickTime. Does anyone have any insight into what might be happening?Hello akaMisterAnderson
I am having the exact problem when I try to rename or move the MOV file. I use Unlocker to determine which process is locking the MOV file and like you have said: it is the Explorer process.
I hope there will be a patch for this problem soon and if you know of any solution, please inform me.
Thanks. -
Passing a FILENAME from a LINUX SHELL Script to an SQLPLUS Script
I written a LINUX Shell Script to receive a FILENAME. This FILENAME is the name of the file that I want to SPOOL into.
So, below are two items.
The first item is the LINUX Shell Script that has the FILENAME
The last item is the SQLPLUS Script that is suppose to receive the name
The LINUX Shell Script:
#! /bin/sh
LOGFILE="$(date +"%Y-%m-%d %H:%M") Oracle REPORT LOG.TXT"
FILENAME="$(date +"%Y-%m-%d") PROD Unfinished Spot Bids.CSV"
echo "File Name for the spool is:" "$FILENAME"
#spool "$FILENAME"
#sqlplus /nolog @run_test_query.sql
#sqlplus -S @Unfinished_Spot_Bids_Run_V1.sql >$LOGFILE
sqlplus -S /nolog <<EOF >$LOGFILE
/* I want to pass to the SQL file below */
/* The value that is contained in the the variable $FILENAME */
/* How do you do that? */
@@Unfinished_Spot_Bids_V1.sql
spool
set echo on
EOF
RV=$?
#if {$RV -ne 0}
#exit $RV
#else
echo "The return code fronm the sqlplus was:" "$RV"
#fi
Here is the SQLPLUS Script
CONNECT glog_read/parker@OTMPROD
set linesize 32000 trimspool on pagesize 3000
set echo off
SET TERMOUT OFF
set heading off
/* I want to parameterize the name of the file below */
/* This file is executed from inside a LINUX Shell Script */
/* That LINUX SHELL script is passed a file name */
/* I want that filename used in the "SPOOL" statement below */
/* So, how do I do that? */
spool PROD_Unfinished.CSV
prompt Shipment Update Date|Shipment Number|No of Shipments|Auctions per Shipment|No. of Carriers Notified|No of Bidders|Duration of Auction|Elapse time for first bid|Elapse time for last bid|Elapse time of bidding|Lead Time of Auction to P/U|High Bid- Low Bid Diff|
set feedback off
SELECT
to_char(c.update_date, 'FMMonth, YYYY')||'|'|| b.SHIPMENT_GID
||'|'|| count (distinct (b.SHIPMENT_GID))
||'|'|| count(distinct(a.i_transaction_no))
||'|'|| count(*)
||'|'|| sum (case when a.responding_gl_user_gid is null then 0 else 1 end)
||'|'|| min (numtodsinterval((b.expected_response - b.insert_date),'day'))
||'|'|| min (numtodsinterval((a.update_date - a.transaction_time),'day'))
||'|'|| max (numtodsinterval((a.update_date - a.transaction_time),'day'))
||'|'|| numtodsinterval((max(a.update_date) - min(a.update_date)),'day')
||'|'|| numtodsinterval((max(b.shipment_time) - max(c.insert_date)),'day')
||'|'|| (max(a.bid_amount) - min(a.bid_amount))
from tender_collab_servprov a, tender_collaboration b, shipment c
where a.i_transaction_no = b.i_transaction_no
and b.shipment_gid not in (select sqa.shipment_gid from tender_collaboration sqa, tender_collab_servprov sqb where sqa.i_transaction_no = sqb.i_transaction_no and sqb.acceptance_code = 'A')
and a.i_transaction_no in (select i_transaction_no from tender_collaboration where tender_type = 'Spot Bid')
and b.shipment_gid = c.shipment_gid
AND c.update_date >= trunc(last_day(to_date((to_char(add_months(SYSDATE,-2), 'MM-DD-YYYY')),'MM-DD-YYYY')) + 1)
group by c.update_date, b.SHIPMENT_GID
order by c.update_date, b.shipment_GID;
spool offParadicePGMR wrote:
First, I was getting an error on the SPOOL ${FILENAME}. Also, my file did have spaces and I did replace it with "_". It still did not work on the SPOOL Command. So, with or without the _, I never got the SPOOL command to work!
It seems that the FILENAME value from the LINUX script was not being passed into the SQLPLUS procedure.
How do you pass LINUX variables into the SQLPLUS procedure>
Not sure if I had the right usage => ${FILENAME}above is correct syntax -
Using script to automatically arrange timeline and sceneline workspaces.
This is a simple demonstration of using VB Script to adjust panels in PE3.
In PE3, when you adjust the height of the timeline, the height of the sceneline is also adjusted the same amount, and vice versa. You could use script to automatically adjust the height of the sceneline or the timeline whenever you switch respective modes. The script below does that.
This is for those who are familiar with script writing and the Windows Script Host. The vb script below includes properties and methods from the AutoItX library (free download).
Option Explicit
Dim oAutoit, strWinText, strLastTime, lngX, lngY
Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
oAutoit.WinWaitActive "Adobe Premiere Elements -"
strLastTime = "start"
Do
' Quit the script if mousepointer put in upper left corner (0,0).
lngX = oAutoIt.MouseGetPosX
lngY = oAutoIt.MouseGetPosY
if lngX = 0 and lngY = 0 then
set oAutoIt = nothing
Wscript.Echo "Your script has ended."
Wscript.Quit
end if
' Read the text of the window so we can determine the workspace setup.
strWinText = oAutoIt.WinGetText("Adobe Premiere Elements -")
' If DVD Menu tab selected, then don't do anything, otherwise
' check if in Sceneline or Timeline mode.
if instr(strWinText, "DVD Menu") = 0 then
if instr(strWinText,"EditTimeControl") <> 0 then
if strLastTime <> "timeline" then
' Reset the Edit Workspace and then adjust the timeline panel height
oAutoit.Send "{alt}wke"
oAutoit.Sleep 250
oAutoit.MouseMove 1078, 646
oAutoit.MouseDown "left"
oAutoit.MouseMove 1078,400
oAutoit.MouseUp "left"
strLastTime = "timeline"
end if
else
if strLastTime <> "sceneline" then
' Reset the Edit Workspace and then adjust the sceneline panel height.
oAutoit.Send "{alt}wke"
oAutoit.Sleep 250
oAutoit.MouseMove 1078, 646
oAutoit.MouseDown "left"
oAutoit.MouseMove 1078,762
oAutoit.MouseUp "left"
strLastTime = "sceneline"
end if
end if
end if
WScript.Sleep 2000
loop
The script might work as-is if your screen is set for 1280 x 1024 and the Premiere Elements 3 window is maximized. Save the script in a text file with a .VBS extension, and then run it. Afterwards click on the Sceneline or Timeline buttons in PE3. It may take up to 2 seconds before the mouse starts moving on it's own. The screen coordinates were ascertained using the AutoIt Info tool.You shouldn't make assumptions about what the names of the volumes are - both the Finder and System Events have terminology to determine if a disk is the startup volume (or a local volume, for that matter), for example:
tell application "System Events"
repeat with someDisk in (get disks whose startup is false and local volume is true)
set someDisk to POSIX path of someDisk
do shell script "diskutil umount " & quoted form of someDisk & " &> /dev/null &"
end repeat
end tell
Note that if you are unmounting a disk from a standard account you will be prompted for administrator authentication. -
How to load data into table Using Script Task
We have a directory/folder where we have a file. We need to insert the File Created Date , File Name , Extension into the database table of Sql server by using Script Task.
So could you please suggest , how to frame the connection string , fetch the file details and insert the data into the database table using Script Task of SSIS 2008You can achieve it as follows using standard script task
1. Add a ForEachLoop container to point to your directory to iterate though the files. Add a variable of type string inside loop to get file name of each file it iterates. Choose option Filename and extension. Add a variable to just store extension part
(FileExtension), set EValuateAsExpression true for it and give expression as below
SUBSTRING(@[User::FileName],FINDSTRING(@[User::FileName],".",1)+1,LEN(@[User::FileName]))
2. Add a script task inside loop and pass filename variable as a read only variable to it. Crete a new variable to get creationdate and pass it as ReadWrite. Inside write code as below
Public Sub Main()
' Add your code here
Dim f As New System.IO.FileInfo(Dts.Variables("FileName").Value.ToString())
Dts.Variables("FileCreatedDate").Value = f.CreationTime
Dts.TaskResult = ScriptResults.Success
End Sub
3. Add a Exec SQL Task after Script task inside loop and give a query like below
INSERT INTO TableName (FileName,CreatedDate,Extension)
VALUES(?,?,?)
and in parameter tab map the parameter placeholders 0,1 and 2 to @[User::FileName],@[User::FileCreatedDate] & @[User::FileExtension] variables
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Problem in creating new label in flashbuilder using script
import
mx.controls.*;
public function init():void{
var Mylabel:Label=new Label;
Mylabel.move(10,10);
Mylabel.text=
"Welcome";
when i use this code it shows Overrides Object.init issue wats wrong in this?can any one provide me right way?I pasted your code into an <fx:Script> block of a new Flex Project in Flash Builder 4 and didn't get any compilation error. If you're getting a compilation error, please post the complete code and the exact wording of the error.
Gordon Smith
Adobe Flex SDK Team -
How to prompt user to select multiple files in file dialog using scripts
Hi, is there a way to allow user to select multiple files inside the file dialog using scripts? So not just something like "*.ai" or "*.eps" but where the user can actually use their shift key to select a batch of files inside the file dialog and then the script would process each one.
Thanks!// Main Code [Execution of script begins here]
here's what I have so far. it would also be nice to not have illustrator stop at errors.. right now, it skips dialogs but on errors, it still stops.
// uncomment to suppress Illustrator warning dialogs
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
var destFolder, sourceFolder, files, fileType, sourceDoc, targetFile, pdfSaveOpts, folderName;
var fullPath = "";
var finalSlash;
// Select the source folder.
sourceFolder = Folder.selectDialog( 'Select the folder with Illustrator .ai files you want to convert to PDF');
f = find_files(sourceFolder);
function find_files (dir)
return find_files_sub (dir, []);
function find_files_sub (dir, array)
var f = Folder (dir).getFiles ("*.*");
for (var i = 0; i < f.length; i++)
if (f[i] instanceof Folder)
find_files_sub (f[i], array);
else
if (f[i].name.slice (-3).toLowerCase() == ".ai" || f[i].name.slice (-4).toLowerCase() == ".eps")
//convert the array-listing to a string so we can manipulate it
fullPath = String(f[i]);
//find the position of the last / to indicate where the filename starts
finalSlash = fullPath.lastIndexOf("/");
//get the foldername by "slicing" from start to where finalSlash is located
folderName = fullPath.slice(0, finalSlash).toLowerCase();
sourceDoc = app.open(f[i]); // returns the document object
// Call function getNewName to get the name and file to save the pdf
targetFile_PNG = getNewName(".png");
if(targetFile_PNG.exists) {
} else {
pngExportOpts = getPNGOptions();
sourceDoc.exportFile(targetFile_PNG, ExportType.PNG24, pngExportOpts );
targetFile_PDF = getNewName(".pdf");
pdfSaveOpts = getPDFOptions();
sourceDoc.saveAs(targetFile_PDF, pdfSaveOpts );
targetFile_SVG = getNewName(".svg");
svgSaveOpts = getSVGOptions();
sourceDoc.exportFile(targetFile_SVG, ExportType.SVG, svgSaveOpts );
sourceDoc.close();
array.push (f[i]);
getNewName: Function to get the new file name. The primary
name is the same as the source file.
function getNewName(ext)
var ext, docName, newName, saveInFile, docName, finalDot
var loop = 0;
docName = sourceDoc.name;
ext = ext; // new extension for pdf file
newName = "";
finalDot = sourceDoc.name.lastIndexOf(".");
while(loop < finalDot)
newName += docName[loop];
loop = loop + 1;
newName += ext; // full pdf name of the file
newName = newName.replace(" [Converted]","");
// Create a file object to save the pdf
saveInFile = new File( folderName + '/' + newName );
return saveInFile;
getPDFOptions: Function to set the PDF saving options of the
files using the PDFSaveOptions object.
function getPDFOptions()
// Create the PDFSaveOptions object to set the PDF options
var pdfSaveOpts = new PDFSaveOptions();
// Setting PDFSaveOptions properties. Please see the JavaScript Reference
// for a description of these properties.
// Add more properties here if you like
pdfSaveOpts.acrobatLayers = false;
pdfSaveOpts.colorBars = false;
pdfSaveOpts.colorCompression = CompressionQuality.AUTOMATICJPEGHIGH;
pdfSaveOpts.compressArt = true; //default
pdfSaveOpts.embedICCProfile = false;
pdfSaveOpts.enablePlainText = false;
pdfSaveOpts.generateThumbnails = false; // default
pdfSaveOpts.optimization = true;
pdfSaveOpts.pageInformation = false;
pdfSaveOpts.preserveEditability = true;
return pdfSaveOpts;
function getSVGOptions()
var svgSaveOpts = new ExportOptionsSVG();
//just using defaults aside from what's written below
//see http://cssdk.host.adobe.com/sdk/1.0/docs/WebHelp/references/csawlib/com/adobe/illustrator/ ExportOptionsSVG.html
svgSaveOpts.embedRasterImages = true;
svgSaveOpts.sVGTextOnPath = true;
return svgSaveOpts;
function getPNGOptions()
// Create the PDFSaveOptions object to set the PDF options
var pngExportOpts = new ExportOptionsPNG24();
// Setting PNGExportOptions properties. Please see the JavaScript Reference
// for a description of these properties.
// Add more properties here if you like
pngExportOpts.antiAliasing = true;
pngExportOpts.artBoardClipping = false;
pngExportOpts.horizontalScale = 100; // scaling to 350%
pngExportOpts.saveAsHTML = false;
pngExportOpts.transparency = true;
pngExportOpts.verticalScale = 100; // scaling to 350%
return pngExportOpts; -
How can apply configure file in ssis by using script task ?
I had two config file in ssis
1. config file as per QA
2. config file as per Production
I think apply dynamically by using script task for above file (acc to server)
How can I apply in script task for config file path in C# script
any one provide Helpful code ??
ThanksI applied script Task with below code :
public void Main()
//User::Config,User::Config_Pd,User::Config_QA
Application App = new Application();
Package Pack = new Package();
DTSExecResult pkgResults;
string strPackageName;
string filename = "";
string configvalue;
configvalue = Dts.Variables["Config"].Value.ToString();
strPackageName = Directory.GetCurrentDirectory().ToString() + "\\Excel Reports from Remittance advice\\Child.dtsx";
try
Pack = App.LoadPackage(strPackageName, null);
if (Pack != null)
if (configvalue == "DEV")
filename = Dts.Variables["Config_QA"].Value.ToString();
else if (configvalue == "PROD")
filename = Dts.Variables["Config_Pd"].Value.ToString();
else
Dts.TaskResult = (int)ScriptResults.Failure;
System.Windows.Forms.MessageBox.Show("Unable to bind the XML Configurations");
return;
} System.Windows.Forms.MessageBox.Show("Config:"+filename);
Pack.ImportConfigurationFile(@filename);
Pack.EnableConfigurations = true;
Pack.Configurations.Add();
App.SaveToXml(strPackageName, Pack, null)
pkgResults = Pack.Execute(); //Pack.Execute();
System.Windows.Forms.MessageBox.Show("Results:" + pkgResults.ToString());
Dts.TaskResult = (int)ScriptResults.Success;
But ouput in ssis showing as
But some thing missed in code plz help me ... -
How to get the kerning value and set it to back use script?
hi,guys
I come back again.
I encountered a kerning problem.
how to get the kerning value and set it to back use script?
Thanks very much!For both cases, the filename can be found on the FILE.ReceivedFileName Context Property. You can access this Property in a Pipeline Component or Orchestration and take any action you want, such as apply to a database.
The value is accessed by: MyReceivedMessage(FILE.ReceivedFileName)
In the case of a duplicate EDI Interchange, you would use the Failed Message Routing feature to capture the error message with either an Orchestration or Send Port. -
Use scripting to create numeric control without inc/dec button
I'm having fun using scripting to do things that were formerly "impossible", such as creating a cluster programmatically from a list of variable names and their associated types (to be used in a subsequent program).
When I create a numeric control on a Front Panel, it has the Increment/Decrement button visible, by default. I wanted to create controls without this feature, but I couldn't figure out how to do this (or even if it is possible, though I don't see why not).
Any ideas?
BS
Solved!
Go to Solution.DFGray wrote:
Create it, then set its Increment/Decrement Visible property to FALSE. This property is specific to digital numerics, so you need a digital numeric reference to make it work. The property is all the way down on the end of the list.
Good thing I read this three or four times before writing my snarky reply!
When I created the new VI Object, I made it a Numeric with style Numeric Control (modern). When I scrolled down the list of properties, they stopped with Unit Label -- in particular, Increment/Decrement Visible wasn't listed. Of course, if I just "lay down" a numeric control, this property is visible.
So I played around a little more. I saw somewhere a reference to the "Numeric Object class", and you refer to "digital numerics" (??? aren't all numeric "digital"?), so I went looking. I found a sub-class of Numerics called NamedNumeric -- not sure what that is, exactly, but what do you know, it has the Increment/Decrement Visible? property!
Time to give it a try ...
BS -
I am completely new to using scripts in a pdf. I'm using Adobe Acrobat Pro. The script I need to use, I believe, is found at this link:
http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=3869
The second part of the script that adds the date to the filename is all I need.
When I open the javascript editor and enter this script, rename b, "*-<date yyyymmdd>", p;
I get this error: Syntax error missing ; before statement
What is the problem, how exactly do I enter that script into the box and, while I'm here, will that script actually do what I need it to do? When you save the document, add the date to the filename? THanks!That script is for a particular application that has nothing to do with Acrobat. Do you have access to Adobe Bridge, which comes with Adobe Creative Suite/Cloud? If so, it can do this with the Batch Rename feature. You can also do it using an Action withing Acrobat using a bit of JavaScript, but it wouldn't be a rename, it would be a save as to a new file, perhaps in a new folder, with the name you want. To save to a new file in the same directory, the script could be something like:
var sPath = path.replace(/\.pdf$/i, "-" + util.printd("yyyymmdd", new Date()) + ".pdf");
saveAs({cPath: sPath, bPromptToOverwrite: true});
This code can be executed in the JavaScript console to save the current document or included in an Action to save a collection of documents.
doc.saveAs documentation: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.524.html -
Beginners question, how to use script?
Hi there
Im on OSX, ID4, soon upgrading to ID5.5
I've been looking for a way to automatically add metadata (author) to a document/exported PDF.
So i found this http://forums.adobe.com/message/3443064 - looks like the answer I'm seeking, but how do i actually put that into use? Where/how to i add the script?
Can it be run upon opening/creating a new document, or upon exporting to PDF?
I'm an experienced indesign user, and I've done some visual basic, php before. But haven't used scripting in InDesign.
Any pointers in the right direction is greatly appreciated. Thanks.
- Lasse FernovHello, ldflkbuc943894353221:
tomaxxi's script in the thread you cite isn't really a normal script. It is a script that installs an event handler that is automatically triggered every time you create a new document in InDesign, suhc as with File > New.
You would save that file as, perhaps, tomaxxiAddXMP.jsx, and then you have some choices. You can just drop it in the User Scripts folder, according to http://www.danrodney.com/scripts/directions-installingscripts.html. At which point you would have to run it once per session (from the Scripts panel, after which point all subsequently created documents would have that happen.
Alternatively, you might want to use it as a startup script. This is an OK idea, except that it might violate your expectations and surprise you sometime if you forget about it. If you follow the above instructions, instead of installing it in the "Scripts Panel" directory, you would go one level up (to "Scripts") and create a directory called "Startup Scripts" and place it there.
Then restart InDesign. It will then always run whenever InDesign starts. -
Where to find the example illustrated how to using script to deploy app
Hi
my new job involves configure and deploy app in WL Server. one of tasks is
to write script and use script file to configure and deploy app.
This script may need to specify the JDBC for various app (like one app
communicates with oracle, the other may want DB2, etc).
anyway, Can any one tell me where to find an example, an URL which shows
what I want?
Thanks lots in advance.
John
Torontoclick window and tick actions. that will open the actions
panel if the flash program. find a frame that contains that button.
click on an spot off-stage and then click on the button. you may
see code in the actions panel that control that button's behavior.
if not, look in the properties panel (window/properties/tick
properties) for the instance name of that button. now search for
code attached to a frame/layer that references that instance
name. -
Is possible to separate path using script....?
Hi Everyone,
I have one overall path and two outer edge path.
use overall path to separate each like pant and tops.
Is possible to separate path using script. I have also tried script but is not working on second separation.
can any rectify that script is possible...?
-yajiv
#target Photoshop
app.bringToFront;
var docRef = app.activeDocument;
var myDocname=app.activeDocument.name
var e=0
try {
var ecp=docRef.colorProfileName;
var n=docRef.pathItems.length;
if(n>0){
if(docRef.pathItems[0].name=="Path 1"){
var pathRef = docRef.pathItems[0].duplicate();
var path1=docRef.pathItems.getByName("1");
//path1.duplicate();
path1.select();
Path_copy();
var pathitem=docRef.pathItems.getByName("Path 1 copy");
pathitem.select();
Path_Paste();
pathitem.operation = ShapeOperation.SHAPEINTERSECT;
Path_Combine();
var path1=docRef.pathItems.getByName("1");
var pathRef1 = path1.duplicate();
path1.select();
path1.remove();
var pathitem=docRef.pathItems.getByName("Path 1 copy");
pathitem.select();
pathitem.name="1";
var pathitem=docRef.pathItems.getByName("Box");
pathitem.select();
Path_copy();
var path1=docRef.pathItems.getByName("1 copy");
path1.select();
path1.name="OL"
Path_Paste();
path1.operation = ShapeOperation.SHAPEXOR;
Path_Combine();
var pathRef = docRef.pathItems[0].duplicate();
var pathitem=docRef.pathItems.getByName("Path 1 copy");
pathitem.select();
Path_copy();
var path2=docRef.pathItems.getByName("OL");
path2.select();
Path_Paste();
path2.operation = ShapeOperation.SHAPEINTERSECT;
alert(path2.operation);
Path_Combine();
catch (e) {
alert(e);
//alert ("PSR_LWC_PLUS_V2_PT - Color Profile not Embedded...\n Check it out...!!!")
function Path_copy(){
var id200 = charIDToTypeID( "copy" );
executeAction( id200, undefined, DialogModes.NO );
function Path_Paste(){
var id204 = charIDToTypeID( "past" );
executeAction( id204, undefined, DialogModes.NO );
function Path_Combine(){
var idcombine = stringIDToTypeID( "combine" );
var desc26 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref25 = new ActionReference();
var idPath = charIDToTypeID( "Path" );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref25.putEnumerated( idPath, idOrdn, idTrgt );
desc26.putReference( idnull, ref25 );
executeAction( idcombine, desc26, DialogModes.NO );Hi c.pfaffenbichler,
Finally with your guidance I rectify the script error.
Thank you for your time and knowledge, I really do appreciate it.
Once again Thanks for your continue support.
"Wish you Happy successful New Year - 2012...!!!"
Regards
-yajiv....
Here is the Code.....!
// create path intersections;
// 2011; use it at your own risk;
#target photoshop
if (app.documents.length > 0) {
var myDocument = app.activeDocument;
// set to pixels;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.POINTS;
var theArray = new Array;
var theNumber = myDocument.pathItems.length;
// »simplify« paths and collect components;
for (var m = 0; m < theNumber; m++) {
myDocument.pathItems[m].select();
combinePath();
theArray.push(collectPathComponents(myDocument, myDocument.pathItems[m]));
var OV_Path=myDocument.pathItems[0]
// create intersections;
for (var n = 1; n < theNumber; n++) {
//alert(OV_Path);
var theFirst = collectPathComponents(myDocument,OV_Path );
var theSecond = theArray[n];
for (var a = 0; a < theSecond.length; a++) {
theFirst.push(theSecond[a]);
var thePath = createPathFromPathComponentActionDesc(theFirst, "intersect",0);
makePath(myDocument.pathItems[0].name+" intersected with "+myDocument.pathItems[n].name);
combinePath();
// create subtraction;
var theFirst = collectPathComponents(myDocument, myDocument.pathItems[0]);
for (var o = 1; o < theNumber; o++) {
var theSecond = theArray[o];
for (var a = 0; a < theSecond.length; a++) {
theFirst.push(theSecond[a])
var thePath = createPathFromPathComponentActionDesc(theFirst, "subtract",1); // Modify the parameter, add flag for function
//subtract
makePath("all others subtracted from "+myDocument.pathItems[0].name);
combinePath();
// reset;
app.preferences.rulerUnits = originalRulerUnits;
function combinePath () {
// =======================================================
var idcombine = stringIDToTypeID( "combine" );
var desc4 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref3 = new ActionReference();
var idPath = charIDToTypeID( "Path" );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref3.putEnumerated( idPath, idOrdn, idTrgt );
desc4.putReference( idnull, ref3 );
executeAction( idcombine, desc4, DialogModes.NO );
//components correspond to subPathItems, subpathList contains the actual paths than can make up one subPathItem ;
////// collect path infor from actiondescriptor //////
function collectPathComponents (myDocument, thePath) {
//var myDocument = app.activeDocument;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.POINTS;
// based of functions from xbytor’s stdlib;
var ref = new ActionReference();
for (var l = 0; l < myDocument.pathItems.length; l++) {
var thisPath = myDocument.pathItems[l];
if (thisPath == thePath && thisPath.name == "Work Path") {
ref.putProperty(cTID("Path"), cTID("WrPt"));
if (thisPath == thePath && thisPath.name != "Work Path" && thisPath.kind != PathKind.VECTORMASK) {
ref.putIndex(cTID("Path"), l + 1);
if (thisPath == thePath && thisPath.kind == PathKind.VECTORMASK) {
// var idPath = charIDToTypeID( "Path" );
var idPath = charIDToTypeID( "Path" );
var idvectorMask = stringIDToTypeID( "vectorMask" );
ref.putEnumerated( idPath, idPath, idvectorMask );
var desc = app.executeActionGet(ref);
var pname = desc.getString(cTID('PthN'));
// create new array;
var theArray = new Array;
var pathContents = desc.getObjectValue(cTID("PthC"));
var pathComponents = pathContents.getList(sTID('pathComponents'));
for (var m = 0; m < pathComponents.count; m++) {
var comp = pathComponents.getObjectValue(m);
var subPathList = comp.getList(sTID("subpathListKey"));
var shapeOp = comp.getEnumerationType(sTID("shapeOperation"));
//alert("shapeOp - "+shapeOp); q
theArray.push([comp, subPathList, shapeOp]);
// by xbytor, thanks to him;
function cTID (s) { return cTID[s] || cTID[s] = app.charIDToTypeID(s); };
function sTID (s) { return sTID[s] || sTID[s] = app.stringIDToTypeID(s); };
// reset;
app.preferences.rulerUnits = originalRulerUnits;
return theArray;
////// create a path from an array of pathcomponents //////
function createPathFromPathComponentActionDesc (theArray, shapeOperation,flag) {
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putProperty(cTID('Path'), cTID('WrPt'));
desc1.putReference(sTID('null'), ref1);
var list1 = new ActionList();
for (var m = 0; m < theArray.length; m++) {
var desc37 = new ActionDescriptor();
if (m == 0 && flag=0) {
desc37.putEnumerated(sTID('shapeOperation'), sTID('shapeOperation'), cTID('Intr'));
else if (m == 0 && flag=1) {//Modify mode to exclude.....!
desc37.putEnumerated(sTID('shapeOperation'), sTID('shapeOperation'), theArray[m][2]);
else {
switch (shapeOperation) {
case "intersect":
desc37.putEnumerated(sTID('shapeOperation'), sTID('shapeOperation'), cTID('Intr'));
break;
case "subtract":
desc37.putEnumerated(sTID('shapeOperation'), sTID('shapeOperation'), cTID('Sbtr'));
break;
case "exclude":
desc37.putEnumerated(sTID('shapeOperation'), sTID('shapeOperation'), 696);
default:
desc37.putEnumerated(sTID('shapeOperation'), sTID('shapeOperation'), theArray[m][2]);
break;
var list5 = new ActionList();
desc37.putList(cTID('SbpL'), theArray[m][1]);
list1.putObject(cTID('PaCm'), desc37);
desc1.putList(cTID('T '), list1);
executeAction(cTID('setd'), desc1, DialogModes.NO);
////// make work path regular path //////
function makePath (aName) {
// =======================================================
var idMk = charIDToTypeID( "Mk " );
var desc4 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref2 = new ActionReference();
var idPath = charIDToTypeID( "Path" );
ref2.putClass( idPath );
desc4.putReference( idnull, ref2 );
var idFrom = charIDToTypeID( "From" );
var ref3 = new ActionReference();
var idPath = charIDToTypeID( "Path" );
var idWrPt = charIDToTypeID( "WrPt" );
ref3.putProperty( idPath, idWrPt );
desc4.putReference( idFrom, ref3 );
var idNm = charIDToTypeID( "Nm " );
desc4.putString( idNm, aName );
executeAction( idMk, desc4, DialogModes.NO );
Maybe you are looking for
-
how do pointers work in java? for example - does a linked list just store pointers to objects? so if you add the same object to 2 linked lists, and then use get(index) in the first list to change that object somehow, would the object in the other lis
-
I type in the code on the iTunes gift card but it says it has not been activate? Please help.
-
Hi All, i am unable to see any thing out put ( excel) . i did not understand where is the issue , can you help me to find out issue. please go through attached xml and excel file. Thank you for your support.
-
Hi, We need a report that shows the accounts receivable due by profit center in order to register doubtful accounts reserve, We try with FAGLL03 but it takes a long time and most of the times is too heavy and collaps... Can anyone help me? Thanks in
-
How can i format a JTextField to a Date format?
How can i do to format a JTextField to a date format, may be with a mask, wich is the way to do this?