Date, File name, User Stamp
I've looked for hours for a script that will work in Illustrator CS4 that will put a text block on the page identifying:
Date, File Name and the User's name on the document (art board)
I am not versed in scripting. Can anyone help me out?
Hi Y'all This post is where scripting all started for me. At the time I didn't know anything and Muppet Mark kindly helped me out. Since then I have learned Applescript and written my slug script in that. This has the advantage of being able to access system information. Here it is:
-- captures the user's first name from the system for use in dialog boxes
set myName to (long user name of (system info))
set sp to (offset of " " in myName)
set myFirstName to text 1 thru (sp - 1) of myName
-- captures the user's short name from the system for use in the slug
set myShortName to (short user name of (system info))
set myInitials to text 1 thru 2 of myShortName
tell application "Adobe Illustrator" to set myDocCount to count of documents
if myDocCount > 0 then
tell application "Adobe Illustrator"
try
set myPath to file path of document 1 as alias -- if the document is not saved this will cause an error
on error
display dialog "You haven't saved document yet " & myFirstName & "." buttons {"Cancel", "Save"} default button 2
-- brings up Save As dialog box
tell application "System Events" to tell process "Adobe Illustrator"
click menu item "Save As..." of menu 1 of menu bar item "File" of menu bar 1
tell application "Finder"
set filesavepath to "/Volumes/Server/Folder" -- put your own file path in here
end tell
delay 0.2
tell window "Save As"
keystroke "g" using {command down, shift down}
repeat until exists sheet 1
delay 0.5
end repeat
tell sheet 1
keystroke filesavepath
click button "Go"
end tell
end tell
end tell
-- end Save As dialog box
return
end try
set myFile to name of document 1
set myFolder to myPath as string
-- this section looks at the file info to get the file version information
set myFileVersion to my getVersion(myPath)
set AppleScript's text item delimiters to "Created"
set myFileVersion to text item 1 of myFileVersion
if myFileVersion is "Saved As v.15 " then
set myFileVersion to "Illustrator CS5"
else if myFileVersion is "Saved As v.14 " then
set myFileVersion to "Illustrator CS4"
else if myFileVersion is "Saved As v.13 " then
set myFileVersion to "Illustrator CS3"
else if myFileVersion is "Saved As v.12 " then
set myFileVersion to "Illustrator CS2"
end if
set AppleScript's text item delimiters to {""}
-- end of file info
set AppleScript's text item delimiters to ":"
set clientFolder to text item 3 of myFolder -- always picks out the client folder on our server
set AppleScript's text item delimiters to {""}
if clientFolder contains "_" then
set clientFolder to my cleanName(clientFolder) -- to format the client names properly
else
set clientFolder to clientFolder
end if
-- find the current date. This is the date when the file was last edited but this method enables you to run the script before saving
tell application "Finder"
set myDate to (current date) as string
end tell
set myDate to (word 2 of myDate) & " " & (text 1 thru 3 of word 3 of myDate) & " " & (word 4 of myDate) as string
-- end find date
-- checks for the correctly named frames and then populates with the correct information
if exists (text frame "titleblock-software" of document 1) then
set contents of text frame "titleblock-software" of document 1 to myFileVersion
end if
if exists (text frame "titleblock-client" of document 1) then
set contents of text frame "titleblock-client" of document 1 to clientFolder
end if
if exists (text frame "titleblock-file" of document 1) then
set contents of text frame "titleblock-file" of document 1 to myFile
end if
if exists (text frame "titleblock-path" of document 1) then
set contents of text frame "titleblock-path" of document 1 to myPath as string
end if
if exists (text frame "titleblock-date" of document 1) then
set contents of text frame "titleblock-date" of document 1 to myDate
end if
if exists (text frame "titleblock-editor" of document 1) then
set contents of text frame "titleblock-editor" of document 1 to myInitials
end if
if exists (text frame "titleblock-version" of document 1) then
set versionCount to get contents of text frame "titleblock-version" of document 1
set versionCount to (versionCount + 1)
set contents of text frame "titleblock-version" of document 1 to versionCount
end if
-- end populating named frames
end tell
end if
-- this handler is to get the version of the file
on getVersion(added_item)
set myFileVersion to long version of (info for added_item)
end getVersion
-- this handler converts every 'odd' character to an underscore, modify as needed
on cleanName(newName)
set chars to every character of newName
repeat with i from 1 to length of chars
if item i of chars as text is equal to "_" then
set item i of chars to " "
end if
end repeat
return every item of chars as string
end cleanName
Similar Messages
-
How to store data file name in one of the columns of staging table
My requirement is to load data from .dat file to oracle staging table. I have done following steps:
1. Created control file and stored in bin directory.
2. Created data file and stored in bin directory.
3. Registered a concurrent program with execution method as SQL*Loader.
4. Added the concurrent program to request group.
I am passing the file name as a parameter to concurrent program. When I am running the program, the data is getting loaded to the staging table correctly.
Now I want to store the filename (which is passed as a parameter) in one of the columns of staging table. I tried different ways found through Google, but none of them worked. I am using the below control file:
OPTIONS (SKIP = 1)
LOAD DATA
INFILE '&1'
APPEND INTO TABLE XXCISCO_SO_INTF_STG_TB
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
COUNTRY_NAME
,COUNTRY_CODE
,ORDER_CATEGORY
,ORDER_NUMBER
,RECORD_ID "XXCISCO_SO_INTF_STG_TB_S.NEXTVAL"
,FILE_NAME CONSTANT "&1"
,REQUEST_ID "fnd_global.conc_request_id"
,LAST_UPDATED_BY "FND_GLOBAL.USER_ID"
,LAST_UPDATE_DATE SYSDATE
,CREATED_BY "FND_GLOBAL.USER_ID"
,CREATION_DATE SYSDATE
,INTERFACE_STATUS CONSTANT "N"
,RECORD_STATUS CONSTANT "N"
I want to store file name in the column FILE_NAME stated above. I tried with and without constant using "$1", "&1", ":$1", ":&1", &1, $1..... but none of them worked. Please suggest me the solution for this.
Thanks,
AbhayPl post details of OS, database and EBS versions. There is no easy way to achieve this.
Pl see previous threads on this topic
SQL*Loader to insert data file name during load
Sql Loader with new column
HTH
Srini -
Sql loader:loading data file name to one of the tabe column.
Hi,
I want to load the data file name also to one of the table column.
Table structure:
File_Name varchar2
Name varchar2
Age number
Data File Format:
Vijay|24
Anandh|24
Senthil|26
In the above eg how to write a control file to load the data file name to the File_Name column of the table.
Note:
The shell script will first pick up the data files to be loaded and calls the control file.
Thanks,
Vijay.From a unix load perspective this is what we have done :
Create a control file (say load_data.ctl) something like
LOAD DATA
append
Into table file_name_age
File_Name constant '<FILENAME>',
Name CHAR TERMINATED BY '|'
Age INTEGER EXTERNAL TERMINATED BY '|' )
in a unix loop do the following
for i in `ls $LOADDIR` ; do
#Replace <FILENAME> with actual filename and create a temp ctl file
sed s/\<FILENAME\>/${1}/g < ${CTLDIR}/load_data.ctl > ${TMPDIR}/load_data_${1}.ctl
#load using temp file
sqlldr / CONTROL=${TMPDIR}/load_data_${1}.ctl
DATA=$i
#remove temp
rm ${TMPDIR}/load_data_${1}.ctl
done
Where
${TMPDIR}=your temp directory
${CTLDIR}=where your main directory for ctl files
$LOADDIR=Your data directory -
Insert data file name into table from sql loader
Hi All,
I have a requirement to insert the data file name dynamically into table using sql loader.
Example:
sqlldr userid=username/passwword@host_string control=test_ctl.ctl data=test_data.dat
test_ctl.ctl
LOAD DATA
FILED TERMINATED BY ','
INTO TABLE test
(empid number,
ename varchar2(20),
file_name varchar2(20) ---------- This should be the data file name which can be dynamic (coming from parameter)
test_data.dat
1,test
2,hello
3,world
4,end
Please help..
Thanks in advance.
Regards
Anujyou'll probably have to write your control file on the fly, using a .bat or .sh file
rem ===== file : test.bat ========
rem
rem ============== in pseudo speak =============
rem
rem
echo LOAD DATA > test.ctl
echo FILED TERMINATED BY ',' >> test.ctl
echo INTO TABLE test >> test.ctl
echo (empid number, >> test.ctl
echo ename varchar2(20), >> test.ctl
echo file_name constant %1% >> test.ctl
echo ) >> test.ctl
rem
rem
rem
sqlldr userid=username/passwword@host_string control=test.ctl data=test_data.dat
rem =============== end of file test.bat =======================
http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_field_list.htm#i1008664 -
Possibility of capturing data file name in SQL * Loader
Hi,
I have a requirement to capture the data file name in the staging table, is there a way that i can capture it in SQL * Loader or any other way of doing it.
Need experts suggestion please.
Thanks,
GenooHi Genoo.
how do we capture the file name and stores in the temporary table
You may use the above command mentioned in my previous post (if Linux) to populate the Test.csv file with the available file name in the directory, i.e:
ls /some/path/*.dat | xargs -n1 basename > /home/oracle/Test.csv
1. Ensure to first load the Test.csv file as for eg:
1,aaa
2,bbb
3,ccc
2. Create a control file to load these records into temporary tables,for eg:
load data
infile '/home/oracle/Test.csv'
into table file_name_upload
fields terminated by ","
( id, file_name )
3. Create the respective table in the database:
create table file_name_upload
id number,
file_name varchar2(20)
4. Load the data into temporary table
sqlldr test/test control=/home/oracle/sqlldr_test.ctl
Please refer notes:
SQL*Loader - How To Load A Date Column With Fractions Of Second (Doc ID 1276259.1)
Script To Generate SQL*Loader Control File (Doc ID 1019523.6)
SQL*Loader performance tips (Doc ID 28631.1)
How To use the Sequence Function of SQL*Loader (Doc ID 1058895.6)
How to Get Data from Existing Table to Flat File Usable by SQL*Loader (Doc ID 123852.1)
Also see link:
10 Oracle SQLLDR Command Examples (Oracle SQL*Loader Tutorial)
Thanks &
Best regards, -
SQLLoader: Uploading data file name along with data
I am using Oracle SQLLoader to upload my data from CSV files into a single table. My current CTL file is as follows:
LOAD DATA
INFILE 'trace_metals100.csv'
INFILE 'trace_metals101.csv'
APPEND
INTO TABLE TRACE_METALS
FIELDS TERMINATED BY ','
(STATION_NO, METAL_NAME, METAL_WT)
Just for my record I want to upload the data file name also along with the data into a fourth column. How should I do it using SQLLoader??
Regards,
MoizDo two loads using two separate control files:
LOAD DATA
INFILE 'trace_metals100.csv'
APPEND
INTO TABLE trace_metals
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(station_no,
metal_name,
metal_wt,
fourth_column_name CONSTANT trace_metals100.csv)
LOAD DATA
INFILE 'trace_metals101.csv'
APPEND
INTO TABLE trace_metals
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(station_no,
metal_name,
metal_wt,
fourth_column_name CONSTANT trace_metals101.csv) -
Can someone help with a previous post labeled "Writing to a data file with time stamp - Help! "
Can someone possibly help with a previous post labeled "Writing to a data file with time stamp - Help! "
Thankswhats the problem?
Aquaphire
---USING LABVIEW 6.1--- -
Quicken data file names are mysteriously being change on my iDisk
within the last couple of days my Quicken data file names are mysteriously being change on my iDisk which seem to make them inaccesable. Not sure why this is happening
within the last couple of days my Quicken data file names are mysteriously being change on my iDisk which seem to make them inaccesable. Not sure why this is happening
-
SQL*Loader to insert data file name during load
I'd like to use a single control file to load data from different files (at different times) to the same table. I'd like this table to have a column to hold the name of the file the data came from. Is there a way for SQL*Loader to automatically do this? (I.e., as opposed to running an update query separately.) I can edit the control file before each load to set a CONSTANT to hold the new data file name, but I'd like it to pick this up automatically.
Thanks for any help.
-- HarveyHello Harvey.
I've previously attempted to store a value into a global/local OS variable and use this within a SQL*Loader control file (Unix OS and Oracle versions between 7.3.4 and 10g). I was unsuccessful in each attempt and approach I could imagine. It was very easy to use a sed script to make a copy of the control file, changing a string within it to do this however.
Do you really want to store a file name on each and every record? Perhaps an alternative would be to use a relational model. Create a file upload log table that would store the file name and an upload # and then have the SQL*Loader control file call a function that would read that table for the most recent upload #. You'll save some disk space too.
Hope this helps,
Luke -
Writing to a data file with time stamp - Help!
My program currently asks the user to enter a path to save the data from my virtual channels. What I want is to have a default directory to store my data in and also have the file name that is created to be the date. I tried to use create open or replace but I cant get it to work. Any suggestions would be great. Also and comments to the code would help out a lot.
Thanks
Attachments:
Test.vi 141 KBLook at the attachment. It uses a front panel path control set to only select a new or existing folder (right click and Browse Options). Then, using a Build Path and a Format Date/Time String, a full path to a file is created. Pass this to your Open/Create/Replace File.
Attachments:
Date to File Name.vi 13 KB -
Printing Data File name on report...
I need the datafile names to print on a report - we give the user serval files to choose from on the report and it would be nice to have the one selected as a note on the report
we use a formula that alowes the to select say a file named New or Current. Both data files are layed out te same just different data. We have a internal formula.
Formula: tsAskFile
Description Use the tsAskFile formula to limit the file types the operator can choose when
the report runs. This formula applies to the main report. It also applies to all
subreports unless you use the tsSubAskFile formula on the subreports. This
formula does not have file merging capabilities. If you use the following formula
example on a report design, the report will prompt the operator to choose
between the New.glt file and the Current.glt file when the report runs. Without
the formula on the report, the operator could choose whatever file codes are
available.
Syntax u201C[<file type>(<file code name>[,<file code name>]*)]u201D
<file type> = the abbreviation of the data file type; for example: BLI, GLT, APT,
etc.
<file code name> = the file code name of the data file; for example: new, current,
history, active, standard, etc.
Example @tsAskFile = u201CGLT(new,current)u201D or u201CGLT(new, current)JCT(current)u201D
So we want to know which one the choose. -
Target Data File Name and Path
Hi,
I'm trying to deploy a mapping that writes data into a file, but I need to dynamically set the name and the directory where I want to write this file. The only workaround I found was manually change the pl/sql generated code and change the values in the FOPEN call with a parameter, but this is no what I really want to do. Does anyone know how to tell WB not to hardcode the file name and path?
I really appreciate you time,
thanks in advance,
MatiasCarla,
Unfortunately our releases do not go that fast...
What you could do as an intermediate solution (this is what I would do) is create your mapping and load into a staging table (this can happen in set-based mode so would be fast). In a post mapping process you manually write to the flat file by making the calls to FOPEN etc. by selecting from the staging table. The post mapping process can have an input parameter that you dynamically pass (i.e. via a mapping parameter) and set the file name.
Mark. -
The "ad" file names look like they're randomly generated. They look like n6sxx8t5.dat and 038prmz7.txt. I get one for every pop-up ad that is generated. That pop-up ad is generally related to the type of web page i'm on when it triggers. it only occurs once per session. what i don't know is if it is also trying to capture any data i'm entering.
like i said, i've deleted the text and index.dat files, but they keep coming back.Do a malware check with some malware scanning programs.<br />
You need to scan with all programs because each program detects different malware.<br />
Make sure that you update each program to get the latest version of their databases before doing a scan.<br />
<br />
* http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
* http://www.superantispyware.com/ - SuperAntispyware
* http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
* http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
* http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
See also:
* "Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked
* https://support.mozilla.com/kb/Searches+are+redirected+to+another+site
If using the above listed scanners does not fix it or if you are blocked from installing those scanners then ask advice on one of the forums that specialize in malware removal mentioned in the <i>Popups_not_blocked</i> article. -
When I change meta data, File name changes too
In iTunes 11.1.3 I have been modifying the Music file ID3 tags (or what ever they're called). I've found, though, that when I change the song name in the "Get Info" dialog box, it also changes the ACTUAL file name of the song.
For example.
I download a a CD and the CD information is downloaded. Then when I drag the newly created mp3 into iTunes and select "Get Info" to modify all of the information.
Once i hit Okay or Next. I watch the File name in Finder change as well.
How do I keep it from doing this?Event Video Guy wrote:
you are a life saver
Event Guy,
Glad it helped. (I also do not like iTunes to mess with the filenames.)
Enjoy the music!
Ed -
How to add file name by sqlldr
Hi All,
Can anyone kindly give me an approach to use a variable in a sql loader ctl file. I am trying to add the value before each insert of row and this value is the file name. So the question is how can I dynamically identify the input data file name, if not, is there a way I can make my SQL Loader to insert a value (file name) before each row into the table.
my control file like below ,
LOAD DATA
INTO TABLE "user"."AAA_BILL"
APPEND
REENABLE DISABLED_CONSTRAINTS
EXCEPTIONS "USER"."AAA_BILL"
FIELDS TERMINATED BY '|'
(Streamnumber ,
MSID ,
UserName,
Domain,
UserIP ,
Correlation_ID)and the loading script as below ,
for j in $(GetFileNames)
do
let i=$i+1
sqlldr user/pass control="/u01/ctrlfile/loadBILLDtl.ctl" log=$WiMAXlog$j.log data=$WiMAXsource$j bad=$WiMAXlog$j.bad
GetFileNames ()
sqlplus -s user/pass << EOF
set echo off
SET FEEDBACK OFF
SET heading off
set pagesize 50000
select bi_file_name from dbm_bill_head where bi_file_name like 'WiMAX_%' and bi_auto_status=35 order by bi_file_name;
EOF
}What I am trying to accomplish here is, I want to insert the data file name along with other data in the data file into table AAA_BILL and this table has the file name coloumn, but the data file does not contain the file name as one of its contents.
Note : my DB is 10G and OS is RHEL
any help please ,
Edited by: 876602 on 18/12/2011 05:44 صHi,
Now it is working just well.
I kept 2 variables: one with the POSIX file path for my do shell script and another one (using the provided tip here) for the Applescript function.
The only problem I had left was that teh file was writen in, maybe, UTF8 so I added to the open for access a "as text" at the end to make the file as straith text file.
I always found languages like Applescript a little bit hard to learn. Strangely, I have less difficulty with Cocoa!
Thanks for avery one here!
Maybe you are looking for
-
Down payment through cash journal
hi, i have a requairment i.e travel advance to employees, we treated every employee as a vendor, how can do this travel advance to employees thanks and regards venkat ravi
-
Creating spreadsheet with changing values
I am trying to create a spreadsheet where the result depends on the value of 2 options selected. Option 1 is a list of different TV manufactures. Option 2 will provide a list of model numbers depending on which manufacturer was chosen in option 1 and
-
Publishing DITA files in Frontmatter and Backmatter
Hello, I am using FM11 and DITA 1.2. I have a bookmap that consists of <frontmatter>, 3 <chapter>, 3 <appendix>, and <backmatter>. In <frontmatter>, I have two <topicref> elements that contain DITA files In the <backmatter> I have my glossary DTIA fi
-
What is Cache refreshing in XI ? Why and when we will do that ?
Hi Experts What is Cache refreshing in XI ? Why we need to do this ? when and all we need to do that ? T.Code: sxi_cache when we will use this ? I have no idea on this and any one give more details on this pl.... Adv..thanx and poi
-
Hi I hit the following error during the data load through sqlldr ORA-39776: fatal Direct Path API error loading table and i hit the following error and sqlldr job terminated and internal error code ORA-00600: internal error code, arguments: [kohdtf04